grafana / cloudcost-exporter

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

[AWS]: Implement Compute module #200

Closed Pokom closed 4 months ago

Pokom commented 4 months ago

There is a need for Grafana Labs to track the cost of ec2 instances and be able to attribute the costs to specific teams. This is very similar to what has already been implemented via the eks module, but with a few distinct differences:

  1. Need to filter out instances associated with EKS clusters
  2. Export the total cost of the ec2 instances
  3. Infer the team associated to the ec2 instance by looking for tags

Associating a team with an ec2 instance has many different ways of implementing. Since a majority of Grafana Labs infrastructure is provisioned as code, the easiest path would be to add a team and workload tag to each ec2 instance provisioned and then set the respective label to the value stored in the tag.

The follow metrics need to be emitted:

The following labels must exist:

Pokom commented 4 months ago

@the-it posed the question on whether or not we even need to associate the the team label. There's a possibility yace already exposes this, and I've posed the question here: https://raintank-corp.slack.com/archives/C050DTQUXUP/p1719324648684559

Pokom commented 4 months ago

Solved with https://github.com/grafana/cloudcost-exporter/pull/211