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.

  1. Open the CloudWatch console.
  2. In the navigation pane, in the Metrics section, choose All metrics.
  3. 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"
}
4. If there are multiple dimensions in the metric that you want to graph, be sure to include them in the metrics section using this format:
[ "NameSpace", "MetricName", "Dimension Key", "Dimension Value" ]
5. To graph multiple metrics, add a comma after the end bracket if there isn't one already. Then, add this to the metrics section:
["NameSpace1", "MetricName1", "Dimension Key1", "Dimension Value1"], ["NameSpace2", "MetricName2", "Dimension Key2, "Dimension Value2"]
6. After you add the JSON to graph your metric, choose Graph metrics. You can now adjust the Time Range, Period and Statistic.

Did this article help?


Do you need billing or technical support?