grafana / cloudcost-exporter

Prometheus Exporter for Cloud Provider agnostic cost metrics
Apache License 2.0
66 stars 4 forks source link

Use Tickers to populate EC2 pricing maps #274

Open paulajulve opened 3 months ago

paulajulve commented 3 months ago

Follow up to https://github.com/grafana/cloudcost-exporter/issues/235

Currently these are populated within the main routine in the Collect method on the ec2 package. It means that every time the exporter goes to collect the metrics, it stops to first check if the compute one is outdated, if it is, populate it, and then the same for the storage one, before moving on to actually collecting the metrics that we want to expose.

This responsibility should not belong to the Collect method. Instead, we could follow the same pattern as the aks package: