How do I graph older metrics that aren't listed on the CloudWatch console?
Last updated: 2022-04-05
I want to graph older metrics that are no longer listed on the Amazon CloudWatch console. How can I do this?
Short description
If data isn't published for more than 14 days, then a metric no longer appears on the CloudWatch console and can't be retrieved using ListMetrics. You can no longer search for this metric to graph it. To view the metric, you must manually provide the metric source.
The example in this article shows you how to view metrics for a terminated Amazon Elastic Compute Cloud (Amazon EC2) instance.
Resolution
Note: Before you begin, check that you have the correct NameSpace, Metric Name and all the Dimensions associated with that metric. A metric is a unique combination of Namespace, MetricName, and Dimension. Note that metric values are case sensitive.
- Open the CloudWatch console.
- In the navigation pane, in the Metrics section, choose All metrics.
- Choose Source, and then enter the JSON block for the metric that you want to graph. This example graphs the CPUUtilization metric of an instance that was terminated 15 days ago:
{
"view": "timeSeries",
"metrics": [
[ "AWS/EC2", "CPUUtilization", "InstanceId", "i-abc123456789" ]
],
"region": "us-east-1"
}
[ "NameSpace", "MetricName", "Dimension Key", "Dimension Value" ]
["NameSpace1", "MetricName1", "Dimension Key1", "Dimension Value1"], ["NameSpace2", "MetricName2", "Dimension Key2, "Dimension Value2"]
Related information
Did this article help?
Do you need billing or technical support?