- Newest
- Most votes
- Most comments
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:
- First 10,000 metrics: 10,000 * ($0.30 / 730) = $0.41
- 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
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:
- 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.
- 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
answered 2 years ago
Relevant content
asked 3 years ago
- AWS OFFICIALUpdated 7 months ago
- AWS OFFICIALUpdated 8 months ago
