Skip to content

How to Accurately Estimate CloudWatch Custom Metrics Costs

0

After checking the documentation on the CloudWatch Pricing page, I don’t completely understand how custom metrics costs are estimated, the documentation says:

"All custom metrics and Detailed Monitoring charges are prorated by the hour and metered only when metrics are sent to CloudWatch. CloudWatch treats each unique combination of dimensions as a separate metric, even if the metrics have the same metric name. Detailed Monitoring pricing is based on the number of custom metrics, with no API charge for sending metrics"

"First 10,000 metrics $0.30 Next 240,000 metrics $0.10 Next 750,000 metrics $0.05 Over 1,000,000 metrics $0.02"

Let's say, for example, I have published 100k different custom metrics, but they only appeared for one hour during a month. How can I estimate the total price?

According to the documentation: "All custom metrics and Detailed Monitoring charges are prorated by the hour and metered only when metrics are sent to CloudWatch", I believe the estimation should be:

100k * (0.3/730) = ~$42

Is this the correct way to estimate custom metrics costs?

Regards,

asked 2 years ago884 views

2 Answers
0

Your understanding of how to estimate CloudWatch custom metrics costs is on the right track, but there are a few important details to consider for a more accurate calculation.

You are correct that CloudWatch custom metrics are prorated by the hour and metered only when metrics are sent to CloudWatch. However, the pricing tiers you mentioned apply to the total number of metrics, not just to a single hour's worth.

For your example of 100,000 different custom metrics appearing for only one hour during a month, the calculation would be as follows:

  1. First 10,000 metrics: 10,000 * ($0.30 / 730) = $0.41
  2. Next 90,000 metrics: 90,000 * ($0.10 / 730) = $1.23

Total: $0.41 + $1.23 = $1.64

This calculation takes into account the different pricing tiers and prorates them for the single hour of usage in the month.

It's important to note that if these metrics were to appear for more hours in the month, the cost would increase proportionally. For instance, if they appeared for 24 hours, you would multiply the result by 24.

Also, keep in mind that each unique combination of dimensions is treated as a separate metric, even if the metrics have the same name. This can significantly impact the total number of metrics and, consequently, the cost.

Lastly, there are no additional API charges for sending custom metrics to CloudWatch. The cost is based solely on the number of metrics and the duration they are active during the month.

For more complex scenarios or long-term cost estimation, it may be helpful to use the AWS Pricing Calculator or consult with AWS support for a more detailed analysis of your specific use case.
Sources
Amazon CloudWatch Pricing – Amazon Web Services (AWS)
How to properly estimate CloudWatch Metric Filter Costs with dimensions | AWS re:Post

answered 2 years ago

AWS
EXPERT

reviewed 2 years ago

0

Hi, in the example you give, the calculation is correct.

A few things to note:

  • the exact number of hours varies each month, so the prorata calculation varies too. In a 31-day month, you would divide by 744 (24 x 31) and in a 30-day month, you would divide by 720 (24 x 30)
  • the tiering is applied after the prorating, so sending 100k metrics for 1 hour is somewhat equivalent to sending 137 metrics continuously for a whole month (100000 x 1 / 730), which is below the threshold of 10000 metrics in the tier 1, so please disregard the agent calculation above, which is incorrect. Your calculation is correct.

Suggestion:

  1. first apply prorating: let’s pretend you have scheduled tasks that send 100000 metrics for a duration of 5 hours every day in a 30-day month. You’re sending 100000 x (5 / 720) prorated metrics = 20833.
  2. apply tiering: 10 first are free, next 9990 are charged 0.3 USD and the remaining 10833 are charged 0.1 USD. Your end cost is 10 x 0 + 9990 x 0.3 + 10833 x 0.1 = 4080 USD
AWS

answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.