amazon-web-servicesamazon-ec2amazon-elbamazon-cloudwatchcloudwatch

Cloudwatch data logs to create a custom dashboard


So I am working on creating my own dashboard for AWS instances, I am trying to determine is there any way to get AWS cloud watch metrics log so that I can get the data and plot it in a graph. I have been working with AWS CLI but wasn't able to get a perfect way to resolve my query. I just need the metrics like

CPU utilization vs time

Disk Utilization vs time

Network Out/In vs time

etc


Solution

  • AWS CloudWatch API can do this for you, the two actions you may need:

    GetMetricStatistics: get time-series data for one or more statistics of a given MetricName.

    ListMetrics: lists the names, namespaces, and dimensions of the metrics associated with your AWS account. You can filter metrics by using any combination of metric name, namespace, or dimensions.

    Apart from the CLI there are also a bunch of SDKs for different languages (Java, .NET, Ruby, JavaScript etc.) that you can use to call AWS APIs. You can find these in the official AWS github repo: https://github.com/aws