Grafana Monitoring? Never been more easy

Grafana Monitoring? Never been more easy

January 02, 2024
Get tips and best practices from Develeap’s experts in your inbox

Let’s start at the end: 

One of the final steps of every major project is using a monitoring solution to monitor your resources and environment. The monitoring solution needs to match the company architecture in the most efficient way, and for that purpose, many monitoring tools were developed. 

One tool is Grafana, which enables you to query, visualize, alert, and explore your metrics, logs, and traces wherever they are stored. Grafana can be deployed in many different ways on your project, but one solution has proven very efficient and easy to manage: Amazon-managed Grafana, or AMG.

My AWS Aha moment 

In my last project, I worked on an AWS serverless cloud environment that included many AWS-managed services such as Lambda, RDS serverless Aurora, API Gateway, SQS, VPN EC2 instance, DynamoDB, etc. When a monitoring solution was required, I started considering all possible options I had. Well, the standard way would obviously be deploying an AWS EC2 server and configuring it to run a Grafana microservice or using another solution requiring servers with Grafana images installed. But then, you will have to configure the connection between your data sources and the cloud. After all configurations of data management, you’ll have to find a way to configure users’ access to your Grafana console. That takes a lot of management, a lot of money for the servers, and mostly a lot of your precious time. So there must be a better way, don’t you think? 

So, while thinking about the best approach I should use and the best monitoring solution in my case, one of my colleagues passed beside me and offered help. I explained the situation, and as we were thinking together he said something: “Isn’t it strange that AWS doesn’t have Grafana of its own?” I replied, “Doesn’t it have?” and immediately started exploring it. I was shocked to discover this amazing AWS service called AMG.

It’s amazing how you can learn new things every day.

Cheers, mate!

Introducing AMG

Amazon Managed Grafana or AMG is a fully managed service of Grafana that provides its users with an easy way to deploy the Grafana workspace, which is all maintained by AWS for you. It helps you monitor, visualize, and analyze data from multiple sources in many accounts and regions, all done with a few clicks in the AWS console. With AMG, you can monitor your environment while integrating with AWS security services, meet corporate security and compliance requirements, and configure and manage users most efficiently. 

Configuring AMG

Amazingly, the easiest part of the entire process is configuring the AMG workspace! It contains only three simple steps:

  1. Create the workspace- you will choose a name for the workspace and select the relevant data sources and notification channels, and that’s it. You are good to go. Of course, you can edit some options according to your preferences, for example, configure a private VPC connection.
  2. Configure datasource in Grafana- In the Grafana console, you have the data source settings. There, you can connect to a wide variety of data sources, such as AWS CloudWatch data sources. When creating the Grafana workspace, if you keep with the default options, there is a role created behind the scenes, managed by AMG, that grants you access to the AWS services you need access. This means that when configuring the AWS-related data sources, you won’t need to specify any credentials for connecting to AWS. It will happen automatically.
  3. As always, the last step of configuring the Grafana is simply creating dashboards and alerts. This can be done with AWS-imported dashboards from the Grafana Labs website.

And That’s it! You can use your Grafana monitoring solution exactly as every other Grafana!

User management with AMG

Another feature of AMG is the management of users. It’s simpler than your guest because you can manage access to your Grafana environment using your identity in the IAM Identity Center. In AMG, in the AWS management console, you can assign users and groups to permissions for AMG.

For example, you can create three groups in IAM Identity Center: my-grafana-admins, my-grafana-editors, and my-grafana-viewers and assign them to their proper permissions in Grafana. Also, if you have a user called my-admin-user, you can assign permissions to it directly.

In other words, it is much easier to manage your users because if you create a new user in the Identity Center, you only need to assign them to their proper group so they will have access to their correct Grafana permissions.

Alerting

Another interesting feature of AMG is its integration with the AWS alerting mechanism. Not only that, the AMG console has regular alerting contact points such as Slack, PagerDuty, etc. But also has AWS SNS integration, which makes the alerting process much easier. You only need to enable SNS when creating the AMG workspace, and that’s it. AWS will automatically add permissions for AMG to use SNS, and you only need to insert the SNS topic ARN, and you are good to go. That way, you can create an architecture that looks like Grafana finding → alert in AMG → trigger SNS → email notification.

As you probably realized, it is just one example out of many because the options you can create with SNS are endless, including a wide variety of AWS-integrated services.

Billing of AMG

So, by now, you are probably asking yourself: “WOW, that’s one amazing service, but how much does it cost?”. And the answer- well, it’s actually really simple to calculate the total billing. You are not paying for storage or managed infrastructure. You’re not paying for the Grafana itself at all! The only thing you will be billed for is active users! 9$ per administrator or editor for a month and 5$ for a viewer. But again, you are only paying for active users, so if I am part of 5 admins in the Grafana admins group, but this month, I was the only user to access the Grafana console, then it will cost me only 9$.

Conclusion

Grafana is one of the most important tools in the monitoring section, and sometimes, it could be challenging to configure or manage it by yourself. AWS AMG provides an easy solution with many useful and secure features to make the process much easier while meeting with many AWS best practices.