Skip to content

How do I reduce and prevent unnecessary charges in CloudWatch?

5 minute read
2

I want to reduce and prevent unnecessary charges that I incur in Amazon CloudWatch.

Resolution

To identify your CloudWatch usage charges, review your AWS Cost and Usage Reports. To reduce and prevent unnecessary charges, review the CloudWatch services, and implement cost-effective methods. It's a best practice to turn on billing alerts to monitor future AWS costs.

Review your CloudWatch custom metrics

CloudWatch detailed monitoring and custom metrics are prorated by the hour and metered when you send metrics to CloudWatch. To reduce CloudWatch metrics charges, take the following actions.

Turn off detailed monitoring for instances, Auto Scaling group launch configurations, and API gateways.

Turn off monitoring for custom metrics. You incur charges when Amazon Simple Storage Service (Amazon S3) or Amazon Simple Email Service (Amazon SES) sends metric request events to CloudWatch. The unified CloudWatch agent uses the PutMetricData API operation to publish. If you call PutMetricData for custom metrics, then you incur charges. Also, you incur charges when you send Amazon Kinesis Data Streams dimensions and metrics and AWS Elastic Beanstalk enhanced health reporting metrics to CloudWatch.

To show only custom metrics, open the CloudWatch console, choose Metrics, then in the Search for any metric, dimension or resource ID field enter NOT AWS.

CloudWatch metric API calls

Charges vary for each CloudWatch metric API operation. If your API operation exceeds the AWS Free Tier quota, then you incur charges. Metrics that third-party monitoring tools capture, such as GetMetricData and GetMetricWidgetImage, aren't included in the AWS Free Tier. For more information, see Is it better to use GetMetricData or GetMetricStatistics for CloudWatch metrics?

To reduce charges from CloudWatch API operations and third-party monitoring tools, use the following best practices:

  • Make ListMetrics calls through the AWS Management Console for free.
  • To reduce the API volume operations and associated charges, batch multiple PutMetricData requests into one API operation and pre-aggregate metric data into a StatisticSet.
  • For third-party monitoring tools, use metric streams to determine a cost effective deployment and retrieve only the metrics that you're monitoring or that you use in workloads.

CloudWatch alarms

The number of metrics that you associate to a CloudWatch alarm can also incur costs. For example, if you have one alarm with multiple metrics, then you're charged for each metric. To reduce charges from CloudWatch alarms, remove unnecessary alarms.

For more information, see Automating Amazon CloudWatch alarm cleanup at scale.

CloudWatch dashboards

Charges for CloudWatch dashboard usage occur in the following situations:

  • You exceed the AWS Free Tier quota of three dashboards with a maximum of 50 metrics for each dashboard.
  • You make calls to the dashboard APIs GetDashboard, ListDashboards, PutDashboard, and DeleteDashboards that exceed the AWS Free Tier quota.
  • You use the Exception: GetMetricWidgetImage API operation.

To reduce charges, take the following actions:

  • Delete unnecessary dashboards.
  • If you're using AWS Free Tier, then limit your total number of dashboards to three.
  • Make dashboard API operations through the AWS Management Console.

CloudWatch Logs

CloudWatch logs incur charges from ingestion, archival storage, and analysis. To reduce charges, take the following actions.

To monitor the volume of logs that workloads generate, view the metric in a CloudWatch graph or dashboard. For high ingestion charges, see How do I identify the log group that causes a sudden increase in my CloudWatch Logs bill? To reduce ingestion charges, check logging levels and remove unnecessary log ingestion. Also, it's a best practice to use infrequent access logs to cost-effectively store your logs.

The retention policy determines how long CloudWatch Logs maintains data. To reduce archival charges, modify the retention policy to a shorter retention period to limit data that's stored over time.

Analysis charges occur when you use Log Insights to query logs or Live Tail to analyze your logs in real time. To reduce the charges that Logs Insights incurs, set your queries to run with shorter timeframes so that CloudWatch scans less data. To reduce the charges that Live Tail incurs, minimize your session usage time.

CloudWatch Contributor Insights

If you exceed one Contributor Insights rule each month or more than one million log events match the rule each month, then you incur charges. To reduce charges, view your Contributor Insights reports and remove unnecessary rules.

CloudWatch Synthetics

CloudWatch Synthetics incurs charges when you exceed 100 canary runs each month. For each canary run, you might incur additional charges for other AWS services that you use, such as AWS Lambda, Amazon S3, CloudWatch Logs, and CloudWatch metrics. To reduce charges, remove unnecessary canaries.

CloudWatch Internet Monitor

CloudWatch Internet Monitor incurs charges for each monitored resource and city networks. You might also incur additional charges for diagnostic logs that you publish to CloudWatch Logs. To reduce charges, set a limit for the maximum number of city networks that you monitor.

Container Insights

Container Insights incurs charges based on the metrics that are collected and the log data that's ingested. If you use enhanced observability for Amazon Elastic Kubernetes Service (Amazon EKS), then Container Insights metrics and logs are charged for each observation. To reduce charges, turn off enhanced observability on your Amazon Elastic Container Service (Amazon ECS) or Amazon EKS clusters.

Related information

Analyzing, optimizing, and reducing CloudWatch costs

Cost Optimization with AWS

1 Comment

For the last few months we've been seeing CW:GMD-Metrics in our costs. We also have USW1-CW:GMD-Metrics (which is - as described above - regional).

Neither of these have resource IDs next to them.

How can I determine which resources are causing these charges?

replied 3 years ago