Why isn't my metric available in the CloudWatch console?

3 minutos de lectura
0

I want to find out why my custom metric isn't available in the Amazon CloudWatch console.

Resolution

Note: If you receive errors when you run AWS Command Line Interface (AWS CLI) commands, then see Troubleshoot AWS CLI errors. Also, make sure that you use the most recent AWS CLI version.

There are two types of custom metrics:

  • With event-driven metrics, the source sends data points only when there's something to report.
  • With schedule-based metrics, the source sends data to CloudWatch periodically, irrespective of the value of the data point.

A metric is available in the CloudWatch console only if a data point was pushed to the metric in the last 14 days. The CloudWatch console limits the search of metrics to two weeks after the metric is last ingested. Therefore, only the most recent metrics appear. If a metric is newly created, then the metric name might take up to 15 minutes to appear in the console.

If your metric isn't available in the CloudWatch console, then try the following methods to retrieve your data points:

  • Use the AWS Command Line Interface (AWS CLI) to make a GetMetricData or GetMetricStatistics API call for the metric. Or, use the AWS SDK. Be sure to specify the correct namespace, metric name, dimensions, and timeframe.
  • Select any metric on the Metric page of the CloudWatch console. Then, edit the browser URL to include the namespace, metric name, and dimension of the metric that's not listed in the console.
  • Select any metric on the Metric page of the CloudWatch console. Then, choose the Source tab to view a JSON object that contains the metric array that defines the namespace, name, and dimensions of the metric. Edit the namespace, metric name, or dimensions. Choose Update to view the metric that's not listed in the console.

Note: CloudWatch applies the following retention settings on its data points. When you specify the period to retrieve a metric, consider the following settings:

  • Data points with a period of less than 60 seconds are available for 3 hours. These data points are high-resolution custom metrics.
  • Data points with a period of 60 seconds (1 minute) are available for 15 days.
  • Data points with a period of 300 seconds (5 minutes) are available for 63 days.
  • Data points with a period of 3,600 seconds (1 hour) are available for 455 days (15 months).

Use either of the following methods to create alarms on metrics that aren't available in the CloudWatch console:

  • Use the AWS CLI or AWS SDK to make a PutMetricAlarm API call. Be sure to use the correct namespace, metric name, and dimensions for the metric.
  • When you create a CloudWatch alarm in the console, you can edit the Metric Name and Dimension values. However, you can't edit the key names for the dimension and namespace with this method. To edit the namespace, choose Edit, and then choose the Source tab in the metric widget. Update the namespace, and then choose Update.

Related information

How do I graph older metrics that aren't listed on the CloudWatch console?

OFICIAL DE AWS
OFICIAL DE AWSActualizada hace 5 días