How do I troubleshoot missing data points in my Amazon CloudWatch metrics?

3 minute read
0

I want to troubleshoot missing data points in my Amazon CloudWatch metrics.

Resolution

Troubleshoot your missing data points based on the metric type:

  • AWS Service metrics
  • Custom metrics

AWS Service metrics

For metrics that are published by AWS, check the source service's documentation. Check when the service pushes data points to the metrics. Also check if it's expected for the metric to have missing data points. For more information, see AWS services that publish CloudWatch metrics.

Custom metrics

Note: CloudWatch doesn't retrieve metrics from your applications. CloudWatch only receives metrics that are sent by your applications. To confirm any issues in metrics that are published to CloudWatch by your applications, check the source service.

For custom metrics, check the source logs to identify the cause of data points that aren't publishing to CloudWatch. Check the following:

  • If your application uses PutMetricData API, then check the application logs on your source for any errors.
  • If you use CloudWatch agent, then check the agent logs on your server for any errors. For more information, see Troubleshooting the CloudWatch agent.
  • If you use Container Insights, then make sure that you completed the setup of Container Insights. Metrics don't appear before Container Insights was set up completely. If all or some pod metrics are missing, then check the agent logs on your container for any errors. For more information, see Troubleshooting Container Insights.
  • If you use an embedded metric format to extract custom metrics from logs, then use the embedded metric format specification for your log structure. Also, use client libraries to generate embedded metric format logs. Then, use the PutLogEvents API or the CloudWatch agent to send them to CloudWatch Logs. For more information, see Embedding metrics within logs.
  • If you use a metric filter to extract terms and patterns from log data, then make sure that you defined the correct filter pattern syntax. Also, make sure that the incoming log data matches the defined pattern. Filters publish the metric data points only for events that happen after the filter was created. For more information, see Creating metrics from log events using filters.
  • Check the metric retention periods when you retrieve the data points from CloudWatch. Data points that are published with a shorter period are aggregated together for long-term storage. Adjust the retention period to see if data points are shown on the graph. For more information, see Metrics retention.
  • Use the get-metric-data or get-metric-statistics AWS CLI commands for metrics that haven't received new data points for the past two weeks or that can't be searched for or found in the console.
AWS OFFICIAL
AWS OFFICIALUpdated 4 months ago