Description
Type: Feature / Question
Is your feature request related to a problem? Please describe.
Currently I am developing an web application with spring boot and I wanted to integrate AWS to collect logs and metrics in AWS Cloudwatch, so that I get informed, if there is e.g. an ERROR-alarm or resources run short. I found this project and in general it worked very well [1]. There is just one (big) thing that concerns me:
I setup a fresh AWS account for this new project and I am using the Free Tier offer from AWS. My guess was, that for simple testing purposes, it will be a good fit. After setting up the dev and production environment a lot of metrics got published (> 200 per instance) to be viewed in Cloudwatch.
On the next day, I got an budget alert notification, that I actually generated real costs. I was wondering and alarmed!
Looking closely at the Free Tier offer it states, that just 10 Metrics are free per month, and every addition metrics costs 0.30 $ per month [2]. A quick calculation let to 60.00 $ per month just for the default metrics per environment. So in my case for dev+prod, 120.00 $.
I immediately disabled the Cloudwatch metrics integration, but I further read [3], that deletion of metrics is not possible and will stay at least 15 months in AWS.
Q: What is the retention period of all metrics?
You can publish and store custom metrics down to one-second resolution. Extended retention of metrics was launched on November 1, 2016, and enabled storage of all metrics for customers from the previous 14 days to 15 months.
Q: Can I delete any metrics?
CloudWatch does not support metric deletion. Metrics expire based on the retention schedules described above.
This results in total cost of of 900.00 $, or in my case 1,800.00, for just "enabling the default metrics integration" and to see what I can get. This is a shocking information for a pet project with no income. :(
Describe alternatives you've considered
If this is really the case, AWS Cloudwatch can not be used as a playground for metrics and alternatives like Prometheus with Grafana have to be used.
Describe the solution you'd like
Maybe my understaning is not correct (please tell me), or the default settings for publishing metrics are way to wild, so that it way to easy to generate actual high expenses for the simplest test-/side-/pet-project that wants to use the AWS Metrics integration. In such a case, a big warning should be placed in the documentation and it shoud be easily configurable, which metrics get published (maybe this is already possible).
I would be curious what you think about this, or if I did something "wrong", or if I am mistaken with some of my assumptions, or if this is how it is currently.
Thanks a lot.
Best regards,
Manuel
Additional context
[1] https://docs.awspring.io/spring-cloud-aws/docs/3.0.0/reference/html/index.html#cloudwatch-metrics
[2] https://aws.amazon.com/cloudwatch/pricing/
[3] https://aws.amazon.com/cloudwatch/faqs/
Cross reference to StackOverflow question: https://stackoverflow.com/questions/76984906/spring-cloud-aws-creates-too-many-metrics-in-aws-cloudwatch-by-default-and-there