grafana / cloudcost-exporter

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

poc(compute): Add cluster label to instance costs #83

Closed Pokom closed 10 months ago

Pokom commented 10 months ago

⚠️ This is only a PoC! Not meant to be merged in until we decide on which approach to take ⚠️

Add a cluster attribute to the machineType struct and associated cost metrics. Cluster name is derived from the instance label goog-k8s-cluster-name. Cluster name is set to an empty string if no value xists for the key.

Thoughts

The nice part of this approach is it's relatively straight forward to implement and get values for the clusters. There is one major draw back: We need to add a cluster label to all metrics emitted, even if they're not part of a GKE cluster. Everything I've gathered is that this will have an impact on queries, dashboards, alerts, and other rules.

Pokom commented 10 months ago

I'm going to close this and defer to #84