Monitoring Amazon DevOps Guru insights using Amazon Managed Grafana

As organizations operate day-to-day, having insights into their cloud infrastructure state can be crucial for the durability and availability of their systems. Industry research estimates[1] that downtime costs small businesses around $427 per minute of downtime, and medium to large businesses an average of $9,000 per minute of downtime. Amazon DevOps Guru customers want to monitor and generate alerts using a single dashboard. This allows them to reduce context switching between applications, providing them an opportunity to respond to operational issues faster.

DevOps Guru can integrate with Amazon Managed Grafana to create and display operational insights. Alerts can be created and communicated for any critical events captured by DevOps Guru and notifications can be sent to operation teams to respond to these events. The key telemetry data types of logs and metrics are parsed and filtered to provide the necessary insights into observability.

Furthermore, it provides plug-ins to popular open-source databases, third-party ISV monitoring tools, and other cloud services. With Amazon Managed Grafana, you can easily visualize information from multiple AWS services, AWS accounts, and Regions in a single Grafana dashboard.

In this post, we will walk you through integrating the insights generated from DevOps Guru with Amazon Managed Grafana.

Solution Overview:

This architecture diagram shows the flow of the logs and metrics that will be utilized by Amazon Managed Grafana, starting with DevOps Guru and then using Amazon EventBridge to save the insight event logs to Amazon CloudWatch Log Group DevOps Guru service metrics to be parsed by Amazon Managed Grafana and create new dashboards in Grafana from these logs and Metrics.

Now we will walk you through how to do this and set up notifications to your operations team.

Prerequisites:

The following prerequisites are required for this walkthrough:

An AWS Account

Enabled DevOps Guru on your account with CloudFormation stack, or tagged resources monitored.

Using Amazon CloudWatch Metrics

 

DevOps Guru sends service metrics to CloudWatch Metrics. We will use these to      track metrics for insights and metrics for your DevOps Guru usage; the DevOps Guru service reports the metrics to the AWS/DevOps-Guru namespace in CloudWatch by default.

First, we will provision an Amazon Managed Grafana workspace and then create a Dashboard in the workspace that uses Amazon CloudWatch as a data source.

Setting up Amazon CloudWatch Metrics

Create Grafana Workspace
Navigate to Amazon Managed Grafana from AWS console, then click Create workspace

a. Select the Authentication mechanism

i. AWS IAM Identity Center (AWS SSO) or SAML v2 based Identity Providers

ii. Service Managed Permission or Customer Managed

iii. Choose Next

b. Under “Data sources and notification channels”, choose Amazon CloudWatch

c. Create the Service.

You can use this post for more information on how to create and configure the Grafana workspace with SAML based authentication.

Next, we will show you how to create a dashboard and parse the Logs and Metrics to display the DevOps Guru insights and recommendations.

2. Configure Amazon Managed Grafana

a. Add CloudWatch as a data source:
From the left bar navigation menu, hover over AWS and select Data sources.

b. From the Services dropdown select and configure CloudWatch.

3. Create a Dashboard

a. From the left navigation bar, click on add a new Panel.

b. You will see a demo panel.

c. In the demo panel – Click on Data source and select Amazon CloudWatch.

d. For this panel we will use CloudWatch metrics to display the number of insights.

e. From Namespace select the AWS/DevOps-Guru name space, Insights as Metric name and Average for Statistics.

click apply

f. This is our first panel. We can change the panel name from the right-side bar under Title. We will name this panel “Insights

g. From the top right menu, click save dashboard and give your new dashboard a name

Using Amazon CloudWatch Logs via Amazon EventBridge

For other insights outside of the service metrics, such as a number of insights per specific service or the average for a region or for a specific AWS account, we will need to parse the event logs. These logs first need to be sent to Amazon CloudWatch Logs. We will go over the details on how to set this up and how we can parse these logs in Amazon Managed Grafana using CloudWatch Logs Query Syntax. In this post, we will show a couple of examples. For more details, please check out this User Guide documentation. This is not done by default and we will need to use Amazon EventBridge to pass these logs to CloudWatch.

DevOps Guru logs include other details that can be helpful when building Dashboards, such as region, Insight Severity (High, Medium, or Low), associated resources, and DevOps guru dashboard URL, among other things.  For more information, please check out this User Guide documentation.

EventBridge offers a serverless event bus that helps you receive, filter, transform, route, and deliver events. It provides one to many messaging solutions to support decoupled architectures, and it is easy to integrate with AWS Services and 3rd-party tools. Using Amazon EventBridge with DevOps Guru provides a solution that is easy to extend to create a ticketing system through integrations with ServiceNow, Jira, and other tools. It also makes it easy to set up alert systems through integrations with PagerDuty, Slack, and more.

 

Setting up Amazon CloudWatch Logs

Let’s dive in to creating the EventBridge rule and enhance our Grafana dashboard:

a. First head to Amazon EventBridge in the AWS console.

b. Click Create rule.

     Type in rule Name and Description. You can leave the Event bus to default and Rule type to Rule with an event pattern.

c. Select AWS events or EventBridge partner events.

    For event Pattern change to Customer patterns (JSON editor) and use:

{“source”: [“aws.devops-guru”]}

This filters for all events generated from DevOps Guru. You can use the same mechanism to filter out specific messages such as new insights, or insights closed to a different channel. For this demonstration, let’s consider extracting all events.

d. Next, for Target, select AWS service.

    Then use CloudWatch log Group.

    For the Log Group, give your group a name, such as “devops-guru”.

e. Click Create rule.

f. Navigate back to Amazon Managed Grafana.
It’s time to add a couple more additional Panels to our dashboard.  Click Add panel.
    Then Select Amazon CloudWatch, and change from metrics to CloudWatch Logs and select the Log Group we created previously.

g. For the query use the following to get the number of closed insights:

fields @detail.messageType
| filter detail.messageType=”CLOSED_INSIGHT”
| count(detail.messageType)

You’ll see the new dashboard get updated with “Data is missing a time field”.

You can either open the suggestions and select a gauge that makes sense;

Or choose from multiple visualization options.

Now we have 2 panels:

h. You can repeat the same process. To create 3rd panel for the new insights using this query:

fields @detail.messageType
| filter detail.messageType=”NEW_INSIGHT”
| count(detail.messageType)

Now we have 3 panels:

Next, depending on the visualizations, you can work with the Logs and metrics data types to parse and filter the data.

i. For our fourth panel, we will add DevOps Guru dashboard direct link to the AWS Console.

Repeat the same process as demonstrated previously one more time with this query:

fields detail.messageType, detail.insightSeverity, detail.insightUrlfilter
| filter detail.messageType=”CLOSED_INSIGHT” or detail.messageType=”NEW_INSIGHT”                       

                        Switch to table when prompted on the panel.

This will give us a direct link to the DevOps Guru dashboard and help us get to the insight details and Recommendations.

Save your dashboard.

You can extend observability by sending notifications through alerts on dashboards of panels providing metrics. The alerts will be triggered when a condition is met. The Alerts are communicated with Amazon SNS notification mechanism. This is our SNS notification channel setup.

A previously created notification is used next to communicate any alerts when the condition is met across the metrics being observed.

Cleanup

To avoid incurring future charges, delete the resources.

Navigate to EventBridge in AWS console and delete the rule created in step 4 (a-e) “devops-guru”.
Navigate to CloudWatch logs in AWS console and delete the log group created as results of step 4 (a-e) named “devops-guru”.
Amazon Managed Grafana: Navigate to Amazon Managed Grafana service and delete the Grafana services you created in step 1.

Conclusion

In this post, we have demonstrated how to successfully incorporate Amazon DevOps Guru insights into Amazon Managed Grafana and use Grafana as the observability tool. This will allow Operations team to successfully observe the state of their AWS resources and notify them through Alarms on any preset thresholds on DevOps Guru metrics and logs. You can expand on this to create other panels and dashboards specific to your needs. If you don’t have DevOps Guru, you can start monitoring your AWS applications with AWS DevOps Guru today using this link.

[1] https://www.atlassian.com/incident-management/kpis/cost-of-downtime

About the authors:

MJ Kubba

MJ Kubba is a Solutions Architect who enjoys working with public sector customers to build solutions that meet their business needs. MJ has over 15 years of experience designing and implementing software solutions. He has a keen passion for DevOps and cultural transformation.

David Ernst

David is a Sr. Specialist Solution Architect – DevOps, with 20+ years of experience in designing and implementing software solutions for various industries. David is an automation enthusiast and works with AWS customers to design, deploy, and manage their AWS workloads/architectures.

Sofia Kendall

Sofia Kendall is a Solutions Architect who helps small and medium businesses achieve their goals as they utilize the cloud. Sofia has a background in Software Engineering and enjoys working to make systems reliable, efficient, and scalable.

Copying signals and dashboards using seqcli templates

Templates make it easy to copy entities like signals and dashboards from one Seq server to one or more others:

Between isolated dev, test, and production environments,
Through blog posts and support documentation, and
Between developers on a team.

(We’re really excited about the last one, because keeping a stash of relevant signals and dashboards will be a great way to get new developers up and running with a useful local Seq instance when joining a project.)

This post covers the fundamentals, but templates are really self-explanatory, and you should be able to achieve just about anything you need to using the information here, in conjunction with the seqcli help template export and seqcli help template import command-line help.

An example signal and dashboard

Our example Seq instance has a selection of signals that identify log events raised when the Seq Cafe roastery receives orders and ships them.

Source server with signals for order lifecycle events.

We also have a nice order status dashboard that shows orders flowing through the roastery:

Orders dashboard showing totals for various order lifecycle events.

We’ll move both the signals and related dashboard to a fresh Seq instance using templates.

The important thing that templates account for is the relationship between the two: the dashboard, when its imported into another Seq instance, needs a reference to the imported copies of the signals.

Exporting the template

The first step when exporting entities from a Seq server is to make a directory for the template files:

mkdir cafe
cd cafe

Then, pointing seqcli at the source server (and using an API key, if required), run:

seqcli template export -s https://source.example.com

The default output location is ., so if you run ls you should see a list of files along these lines:

dashboard-Orders.template
signal-Order Abandoned.template
signal-Order Created.template
signal-Order Placed.template
signal-Order Shipped.template

I’ve deleted everything except for the dashboard and signals we intend to export.

If the entities you’re expecting aren’t there, you may need to share them, or identify them explicitly on the template export command-line using -i <id>. By default, seqcli will only export shared entities.

Peeking inside the template files

The template files are plain text. Here are the first dozen lines or so lines of dashboard-Orders.template:

{
“$entity”: “dashboard”,
“OwnerId”: null,
“Title”: “Orders”,
“IsProtected”: false,
“SignalExpression”: null,
“Charts”: [
{
“Title”: “Order Lifecycle”,
“SignalExpression”: null,
“Queries”: [
{
“Measurements”: [
{
“Value”: “count(@EventType = 0x8CC54029)”,
“Label”: “shipped”
},

If you’ve spent time using Seq’s HTTP API, the entity structure here will be familiar.

Template files are JSON with placeholders. A little farther down in the dashboard template, where the dashboard makes reference to one of the associated signals, you’ll see a placeholder:

{
“Title”: “Created”,
“SignalExpression”: {
“SignalId”: ref(“signal-Order Created.template”),
“Kind”: “Signal”
},
“Queries”: [

The function-call-like ref(“signal-Order Created.template”) looks up the id of the signal that was imported from the signal-Order Created.template file on the target server.

Importing again

Importing the template into the target server is as easy as:

seqcli template import -s https://dest.example.com –state ./dest.state

You’ll notice that the import command accepts the path of a state file: this file tracks the mapping between templates and the entity ids assigned to them on the target Seq server. If the same state file is used in later imports, entities that already exist will be updated instead of duplicated.

Here’s our target server, with the dashboard and signals imported 😎.

The orders dashboard imported into the target server.

Getting seqcli

The Seq installer for Windows includes a copy of seqcli, so you’ll find it’s already on the PATH if you have Seq installed on that OS.

For macOS and Linux, binaries can be downloaded from GitHub, or, you can docker run the datalust/seqcli container.

Have fun!

New React Templates in the Family of Flatlogic Dashboards

Sofia React FULL
Sofia React Nodejs
Flatlogic ONE React Node.js

Hey there!

In addition to the free versions of Sofia React Template and Flatlogic One React template, we’ve released three more upgraded versions of our latest React templates. Meet them with a big round of applause:

React Template based on Bootstrap and Material-UI
React Template based on Bootstrap and Material-UI with Node.js Backend
Flatlogic ONE React NODE.JS – React admin template with Node.js backend

Read more to know the details of each template or just run through our React templates compilation to get the gist of the news.

Sofia React FULL

Sofia React Full Template

Demo
More Info
Documentation

Sofia React Full template is a new highly responsive template built with the help of Bootstrap 4.6 and React 17. This React template has all features and pages to start any type of web app, like SaaS, CMS or CRM platforms, project management tools, or financial management software.

We’ve explored the market of React templates to understand what are the basic and the most important features of a good React template. So, we propose a robust version of Sofia React template with in-depth documentation and a list of the following integral features inside:

Well-documented Codebase
React Hooks
Form validation (Formik)
Login and Signup pages
Static Sidebar
A wide range of charts

Sofia React Node.js

Sofia React Node.js Template

Demo
More Info
Documentation

Sofia React Nodejs is an upgraded version of our free React dashboard, called Sofia. If you’re looking for a beautiful but functional React dashboard template, Sofia React Nodejs is probably the best solution to get your web project up and running.

This version of Sofia React is powered by Node.js that enhances the performance ability of the web apps to the next level. With this template, you can build any type of eCommerce store, just like the giant marketplaces eBay, Amazon, or AliExpress.

It was made with the help of the Material-UI framework for the frontend; the latest version of React, that is React 17, Bootstrap 4.6, and Node.js for the backend. The template got also React Hooks and React Router v5 for routing, and Sass that lets you quickly and easily change styles.

Perfect for any type of CRUD Application
Node.js & PostgreSQL integrated
User Management option
Colorful Charts Libraries
Form validation (Formik)
Login and Signup pages

Flatlogic ONE React Node.js

Flatlogic One React Nodejs

Demo
More Info
Documentation

Flatlogic One React Nodejs is one more fully working solution for your eCommerce project. This React template is an enhanced version of Flatlogic One Template.

This is a multipurpose eCommerce template that will help to kick off your next project effortlessly. Flatlogic One React Nodejs was filled with dozens of UI elements, like buttons, popovers and tooltips, icons and glyphicons, etc. The template has a unique design, a wide variety of layouts, and all the necessary elements of a powerful web template.

It becomes easier to create a fully working front-end React app with dozens of UI components like tables, widgets, tables, and calendars, a fully functional sidebar; various login methods, and other essential options like:

Sleek chart libraries (Amcharts, Echarts, and Apexcharts)
Developer-oriented dashboards
Deep background
Login screen
Different icons and notifications
Flatlogic typography
Flatlogic datatables
Google Maps

Summing Up

And for the rest of our React templates, check our marketplace. If you face any difficulties setting up this or that template or admin dashboard, please feel free to leave us a message on our forum, Twitter or Facebook. We will respond to your inquiry as quickly as possible!

Thanks!

Suggested Articles

Flatlogic One Bootstrap Admin Template is Released
Ready-to-use e-Commerce Template is Released!
Full Stack Web Application Generator by Flatlogic

The post New React Templates in the Family of Flatlogic Dashboards appeared first on Flatlogic Blog.