Latest news about Bitcoin and all cryptocurrencies. Your daily crypto news habit.
Hybrid cloud is the new reality. Therefore, you will need a single tool, general purpose dashboard and graph composer for your global infrastructure. That’s where Grafana comes into play. Due to it’s pluggable architecture, you have access to many widgets and plugins to create interactive & user-friendly dashboards. In this post, I will walk you through on how to create dashboards in Grafana to monitor in real-time your EC2 instances based on metrics collected in AWS CloudWatch.
To get started, create an IAM role with the following IAMÂ policy:
Launch an EC2 instance with the user-data script below. Make sure to associate to the instance the role we created earlier:
On the security group section, allow inbound traffic on port 3000 (Grafana Dashboard).
Once created, point your browser to the http://instance_dns_name:3000, you should see Grafana Login page (default credentials: admin/admin)Â :
Grafana ships with built in support for CloudWatch, so add a new data source:
Note: In case you are using an IAM Role (recommended), keep the other fields empty as above, otherwise, create a new file at ~/.aws/credentialswith your own AWS Access Key & Secret key.
Create a new dashboard, and add new graph to the panel, select AWS/EC2 as namespace, CPUUtilization as metric, and the instance id of the instance you want to monitor in the dimension field:
That’s great !
Well, instead of hard-coding the InstanceId in the query, we can use a feature in Grafana called “Query Variables“. Create a new variable to hold list of AWS supported regions :
And, create a second variable to store list of instances ids per selected AWSÂ region:
Now, go back to your graph and update the query as below:
That’s it, go ahead and create other widgets:
Note: You can download the dashboard from GitHub.
Now you’re ready to build interactive & dynamic dashboards for your CloudWatch metrics.
AWS CloudWatch Monitoring with Grafana was originally published in Hacker Noon on Medium, where people are continuing the conversation by highlighting and responding to this story.
Disclaimer
The views and opinions expressed in this article are solely those of the authors and do not reflect the views of Bitcoin Insider. Every investment and trading move involves risk - this is especially true for cryptocurrencies given their volatility. We strongly advise our readers to conduct their own research when making a decision.