In this video, you'll see how you can add dashboards, panels, alerts, and transformations in Amazon Managed Grafana.
With this solution, you can visualize performance metrics from multiple data sources,
transform and query operational data, and set alerts and notifications to proactively capture issues.
For the purposes of this demo, we have already created an Amazon Managed Grafana workspace.
Let’s look at our data sources.
Amazon CloudWatch and Amazon Managed Service for Prometheus (AMP) are configured as data sources.
The Grafana workspace is also configured with the Amazon Simple Notification Service (Amazon SNS).
The SNS collects any notifications in the region, and our AMP workspace collects the metrics.
Our AMP workspace, seen here, is set up to ingest and collect metrics from two Amazon Elastic Compute Cloud (Amazon EC2) instances.
Let's quickly review the configuration of our EC2 instances in AWS Cloud9.
The first instance is running the Prometheus service and a node exporter service to send metrics to the AMP workspace.
The code of the Prometheus service assigns it to scrape and remote-write the metrics to the AMP workspace.
Both EC2 instances mounted with Amazon Elastic File System (Amazon EFS).
You can learn more about ingesting metrics from an EC2 instance into AMP using the links in the description of this video.
Now let's clear the AWS Cloud9 commands and access our Grafana workspace.
Here you can see that Amazon CloudWatch and Amazon Managed Prometheus are already configured as data sources.
We can also see the Amazon SNS notification channel we set up for our workspace.
Now we're ready to create a new dashboard.
Let’s create one that lets us monitor the Amazon EFS metrics.
We’ll add two rows so we can distinguish the Prometheus and CloudWatch metrics.
Let’s save and name the dashboard.
Now let's create a panel in the CloudWatch row.
For this one, we'll build a stat panel to represent the total storage of the Amazon EFS files.
We'll specify the data source and region, then configure the panel using a query expression.
We'll make some more adjustments to represent the data to fit our needs and name the panel.
Let’s also provide a description.
Now we'll finish configuring the panel.
Let's change the unit to bytes per second.
We'll use this unit for all the dashboard panels.
Let's also delete the threshold value.
We'll save the panel and apply it to our dashboard.
Next, we’ll add a panel to the CloudWatch row that calculates the total throughput.
We'll use a time series view for this panel.
As with our first panel, we'll select the data source and region, write a query expression,
adjust the specifications, and configure the on the right.
For the purposes of this demonstration, we'll skip ahead so we can quickly create an alert on this panel.
We can assign alerts when building panels to help us monitor and analyze our metrics.
Let's build an alert that activates if the Amazon EFS exceeds a threshold of 50 megabytes.
We’ll send alerts to the Amazon SNS notification channel we created.
Let's save and apply the panel.
We also want to create a few panels in the Prometheus row.
First, however, let's define a few variables that we can query in those panels.
Variables are displayed as dropdown lists at the top of the dashboard.
These dropdowns make it easy to change the data being displayed in your dashboard.
We’ll begin by defining an instance variable that queries the Prometheus workspace.
Select Update to save the variable.
Now let’s create a variable that queries the EFS file system.
Let's update the variable and then save the dashboard.
Now we can add panels to the Prometheus row.
For the purposes of this demonstration, we're going to skip ahead and take a look at the query expression for this third panel.
With our Prometheus data source, this time-series panel we've built calculates the throughput in bytes sent and received with our client.
Let's save and apply the panel.
Let’s add one more panel to calculate the total read/write throughput endpoint.
We'll supply the query expression for the total write throughput first.
Now we can copy the query and make some adjustments so it calculates the read throughput.
Next, we'll apply a transformation that joins the two time series together.
This changes the panel visualization and helps us to infer more relevant information from our dashboard.
With our transform applied, let's skip ahead to our completed panel.
Let's save and apply our panel.
With our panels built, we can load some data into the EC2 instances and watch how the metrics appear on our dashboard.
Let's return to the AWS Cloud9 terminal of our EC2 instance.
Using this command, we'll introduce the load test from two different EC2 instances.
On the first EC2 instance, we'll perform the read test using the copy command.
On the second EC2 instance, we'll perform the write test to the EFS.
Let's return to the dashboard in our Grafana workspace.
We can adjust the settings to have the dashboard auto-refresh every 10 seconds,
and then monitor the changes on our panels.
The load metrics are already showing up.
Let's watch for the alert to activate on the EFS Total I/O Throughput panel.
As you can see, the alert on the EFS Total I/O Throughput panel has changed to yellow,
indicating that the data threshold is close to its 50-megabyte capacity.
Let's continue to monitor the dashboard as data loads into the Prometheus and CloudWatch data sources from the EC2 instances.
As you can see from the red alert icon, total EFS throughput just exceeded the 50-megabyte capacity.
We can see the type of workload running, read or write.
We can also see the traffic for each EC2 instance.
We can also filter the panels according to a particular EC2 instance, using its IP address.
Let's change the view back to include both EC2 instances.
We can share this dashboard with others who have access to our Grafana workspace by copying and sending its link URL.
Or we can export the dashboard as a file and send it to external users.
You've just seen how you can add dashboards, panels, alerts, and transformations in Amazon Managed Grafana.
You can learn more about this topic in the description and links for this video.
Thanks for watching. Now it’s your turn to try.