When it comes to CloudWatch Metrics, you will be charged for two things:
Custom metrics (Any metrics with a namespace other than AWS namespaces) that you are pushing to CloudWatch Service using either:
#-- > CLI\API
#-- > CloudWatch Agent
below API call requests:
#-- > GetMetricData
#-- > GetInsightRuleReport #-- > GetMetricWidgetImage
#-- > GetMetricStatistics
#-- > ListMetrics
#-- > PutMetricData
#-- > GetDashboard
#-- > ListDashboards
#-- > PutDashboard
#-- > DeleteDashboards
As for metric retention, it is only a way where AWS CloudWatch service aggregate your metrics raw data points for long-term storage. CloudWatch retains metric data as follows:
#. 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 minute) are available for 63 days
#. Data points with a period of 3600 seconds (1 hour) are available for 455 days (15 months)
Metrics cannot be deleted, but they automatically expire after 15 months if no new data is published to them in the last 2 weeks.
Data points older than 15 months expire on a rolling basis; as new data points come in, data older than 15 months is dropped.
I suggest to look at your CloudWatch custom metrics (Any metrics that is not in AWS namespaces) and try to analyze which application\Scrip\Code is publishing those metrics and how frequent.
The AWS namespaces typically use the following naming convention: AWS/service. For example, Amazon EC2 uses the AWS/EC2 namespace.
ShuaibA-AWS, thank for the reply.
I think something is misconfigured with my could watch because I have tried all the basic stuff over the past several months and nothing seems to help. But, it is possible I am missing something so hopefully you can help with this a little more.
I've looked into the detailed cost and you are right that those fees are related to custom metrics.
For example below are the important columns from my cost and usage spread sheet.
AmazonCloudWatch -- CW:MetricMonitorUsage -- MetricStorage -- $0.30 per metric-month for the first 10,000 metrics -- Custom Metrics
At https://console.aws.amazon.com/cloudwatch I have tried the following things for over a 1 month period:
- Removed all custom dashboards
- Made sure none of the Metrics were graphed under Metrics>Graphed metrics.
- Made sure I had no logs or events
I do have 30 custom metrics under CWAgent. I can't even remember how I got all those added years ago. A few are useful like CPU utilization and ram utilization. However, most I've never used other than in a few experiments a few years ago. My understanding is they are supposed to be removed after 2 weeks of not being uses, but they have never been removed. This combine with the charges I see makes me think something is using these metrics, but I don't know how to stop using them. Is there some other way I can stop using them?
I have also https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Agent-Configuration-File-Details.html to look directly at my amazon-cloudwatch-agent.json file and make sure the configuration makes sense. In the past I even modified it to have no metrics in it when doing the steps I mentioned didn't help, but right now it has a few that match what my custom dashboard is.
The documents for cloudwatch say that 50 metrics are free. It isn't completely clear if that includes any custom metrics, but I think it does. Even if it doesn't in the past I've tried to use no custom metrics and I was still getting charged for them.
Do you have a suggestion on how to make sure I'm not using an custom metrics?
Thanks again for your help!
Thanks for your reply. It has helped refresh my memory that I setup a metricAgent on my instance several years ago.
Is the best way to modify my metric agent to change the amazon-cloudwatch-agent.json file? I have put my current file at the end of the document. I can certainly increase the interval and remove a few things from this file. I see 9 metrics with 30 second intervals.
I'm a little confused how things are priced for this, but I am now guessing this is why I am getting charged. I'd be fine paying the $0.30 for 10K metrics, but I'm not sure how those are counted. If I made my metric just report back every hour instead of every 30 seconds then with my current number of metrics I would expect to stay under 10K metrics for the month so just $0.30. Is that right, or am I counting this incorrectly?
I did try modifying amazon-cloudwatch-agent.json in the past and it didn't seem to help, but I'm willing to try that again the experts here think that should help.
As a CloudWatch user monitoring servers in the AWS console, I will guess you are monitoring EC2 instances.
You are likely to incur charges in two areas monitoring EC2: Custom Metrics and Detail Monitoring metrics.
Basic EC2 metrics are sent to CloudWatch on a 5-minute interval for free.
If you are monitoring RAM on your server, then you likely have the EC2 CloudWatch Agent installed and running on your EC2 instances. CloudWatch Agent sends additional EC2 instance metrics to CloudWatch as Custom Metrics, for example mem_total and mem_free.
Also, when you configure your EC2 instances, you can choose to enable Detail Monitoring to emit EC2 metrics at a faster 1-minute interval.
Here are some resources to help you understand which metrics are available and their pricing:
CloudWatch metrics for your instances: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/viewing_metrics_with_cloudwatch.html
Metrics Collected by the CloudWatch Agent: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/metrics-collected-by-CloudWatch-agent.html
Enable or disable Detailed Monitoring for your instances: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-cloudwatch-new.html
CloudWatch Pricing Page: https://aws.amazon.com/cloudwatch/pricing/
Custom Metrics are charged $0.30 per metric per month. They are pro-rated by the hour and you are only charged for a metric during an hour in which that metric receives a datapoint. As long as a Custom Metric receives a datapoint at-least once per hour, it will be $0.30 per month.
CloudWatch Agent is a software service you installed on your EC2. While it is running, it will send Custom Metrics to CloudWatch and put them in CWAgent.
If you no-longer wish to receive Custom Metrics from your EC2, your best course is to stop and/or uninstall the CloudWatch Agent running on your EC2.
Instructions for stopping CloudWatch Agent are here: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/troubleshooting-CloudWatch-Agent.html#CloudWatch-Agent-troubleshooting-stopping-restarting
I am pretty convinced it was this cloudwatch agent and I have uninstalled that to verify it solves my issue. Thanks for all the help!
How to monitor bounces and complaints with CloudWatch?asked 8 months ago
CloudWatch Agent Metric Namespaces not respecting configurationasked 3 years ago
Is it possible to see CPU Utilization monitoring over a longer period than just two weeks?asked 2 months ago
how can I configure cloudwatch to monitor things like CPU/RAM/Disk/IO for auto scaling groups using a wildcard?asked 9 months ago
Can we monitor the status of external devices such as routers, sensors, etc in cloudwatch ?asked 2 months ago
Scale errors on simple CloudWatch DashboardAccepted Answerasked 10 months ago
How to monitor RAM memory usage of an EC2 Ubuntu instanceAccepted Answerasked 9 months ago
Cloudwatch monitor linux server load vs CPUasked 3 months ago
About how to monitor ephemeral storage usage in FargateAccepted Answerasked 4 months ago
Cloudwatch Fees from Metric Storage Issueasked 2 years ago