cloudwatch_exporter
cloudwatch_exporter copied to clipboard
Cache result of ListMetrics calls
Proposal
Use case. Why is this important?
In my opinion calling ListMetrics every minute is waste of money - resources aren't created and removed so often. To avoid that caching could be implemented with configurable TTL. In our use case we generate about 6 times more ListMetrics than GetMetricData requests, and they both are charged same way, so that would be huge money saver.
How do you think the new configuration should look like?
Example:
list_metrics_cache_ttl: 5m
Yes, that's a great idea!
What should the default be? Preserve the current behavior, or can we settle on a reasonable default?
In my opinion 5m could be safe default - if you poll CW every 1 minute, that will save 80% of ListMetrics calls without excessive time needed for exporter to see new resources.
Seems it has been implemented by @mtt88 in #453. Thanks! I'll test functionality and close issue if it works fine.

All good, TTL is set to 60 minutes on above screen. That will make huge difference on AWS bills, many thanks again.