grafana / cloudcost-exporter

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

Paula/add ebs pricing metrics #240

Closed paulajulve closed 3 months ago

paulajulve commented 4 months ago

re https://github.com/grafana/cloudcost-exporter/issues/235

This PR:

Next steps, out of the scope of this PR:

This code emits metrics in this format:

# HELP cloudcost_aws_ec2_persistent_volume_usd_per_hour The cost of an AWS EBS Volume in USD.
# TYPE cloudcost_aws_ec2_persistent_volume_usd_per_hour gauge
cloudcost_aws_ec2_persistent_volume_usd_per_hour{availability_zone="ca-central-1a",disk="vol-<id>",persistent_volume="pvc-<pvc>,region="ca-central-1",size_gib="300",state="available",type="gp2"} 33

The labels aren't necessarily the final ones we'll settle on, but rather a starting point to see how those serve us. Naming is subject to change too.

paulajulve commented 4 months ago

I've organised the changes into two more meaningful commits to make final review easier. First one is just a no-op refactor of the old code to prepare it to fit the new bits. Second one adds all the new functionality.

I think I've addressed all previous comments. This code is now ready to review 🎉