In this video, you’ll see how to use Amazon CloudWatch as a data source for Amazon Managed Grafana.
With this integration, you can collect data from CloudWatch in Grafana,
identify errors through logs, metrics, and dashboards, and automate responses to operational changes.
Let’s begin by enabling AWS Single Sign-On (SSO),
which we’ll be using as the authentication method for our Amazon Managed Grafana workspace.
Next, we’ll add a user that can log into our workspace.
Let’s create a group and add this user to it.
Now that we’ve added the user, we’ll copy the user’s password and head to Amazon Managed Grafana.
Amazon Managed Grafana is a fully managed Grafana service that allows you to query, visualize,
and understand your metrics no matter where they’re stored.
Let’s create a workspace.
As part of creating a workspace, you must choose at least one authentication method.
For this example, we’ll use AWS SSO.
We’ll use the service managed permission type, so AWS will automatically provision the permissions based on the services we choose.
Next, we can select data sources.
This will create an AWS Identity and Access Management (IAM) role that enables Amazon Managed Grafana to access those resources in the current account.
For our purposes, let’s select Amazon CloudWatch.
If we want to set up notifications in Grafana, we’ll need to select Amazon SNS as the notification channel.
Let’s do so.
Now we’ll review the settings and create the workspace.
While the workspace is being created, let’s briefly head to CloudWatch to review our data source.
CloudWatch is receiving metrics and logs from a Kubernetes cluster built using Amazon Elastic Kubernetes Service (EKS).
Here we can confirm we have log groups ingesting data from the EKS cluster.
We’ve also leveraged Container Insights, which can interact with both Amazon Elastic Container Service (ECS) and EKS.
Let’s take a quick look at our EKS cluster.
Now let’s go back and check on the status of our workspace.
The workspace is created.
Next, we’ll assign users and groups access to it.
We’ll assign the user we created earlier.
By default, this user has viewer permissions.
Let’s make the user an admin.
As an admin this user can now log in, set up data source configuration, and create dashboards in Grafana.
Now let’s go to the Grafana dashboard to sign in as the user we added.
We are now in the Grafana dashboard as a user with admin privileges.
Let’s add CloudWatch as a data source.
To make the settings easier to see, let’s change the UI scheme to Light.
We’ll select US West-2, or Oregon, as the default region.
Let’s look at the settings of our provisioned data source.
We’ll retain these settings, and save and test the data source.
Now that we’ve confirmed that it works, let’s specify it as the default, and then save and test once again.
Next, we’ll import some prebuilt dashboards for visualization.
Let’s import the Amazon CloudWatch Logs and Amazon EC2 dashboards.
Both of these are available out of the box.
We’ll test one more time.
Now, if we go to Explore, we can see the connected data source.
Let’s take a look at the dashboards we just imported.
We’ll open the dashboard for Amazon CloudWatch Logs.
Here we can see CloudWatch logs and metrics from our pre-existing application that leverages Container Insights.
Let’s try adjusting the timeframe.
We’ll change the window to include data from the last 24 hours.
We can also refresh the view, or set it to refresh automatically.
Let’s have it refresh every 5 seconds and expand the time window to the last 2 days.
We can also zoom in or out.
The ability to see metrics and log data through Grafana can help build out observability and monitoring for a specific project within a specific workload,
or within a specific product team within the organization.
We can also create our own panels and add them to the dashboard.
Our home page shows our recently viewed dashboards, and we can star our favorites to find them faster when the list gets longer.
You’ve just seen how to use Amazon CloudWatch as a data source for 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.