grafana / cloudcost-exporter

Prometheus Exporter for Cloud Provider agnostic cost metrics
Apache License 2.0
23 stars 0 forks source link

Persistent Volume Hourly Cost Metric #95

Open Pokom opened 7 months ago

Pokom commented 7 months ago

So far we've focused our efforts on exporting metrics for the following resources:

One metric distinctly missing is tracking the hourly cost for persistent volumes. We would need two metrics:

These two metrics can then be joined together to calculate the total in spend (spend = usage * rate) for persistent volumes.

For both metrics, we need need the following labels:

### Tasks
- [x] Implement persistent volume in GCP
- [ ] https://github.com/grafana/cloudcost-exporter/issues/235
- [ ] https://github.com/grafana/cloudcost-exporter/issues/236
the-it commented 7 months ago

Could we also just have one metric for each PVC, just cost per hour. If we need to scrape all PVCs, we also know there size, then we also know there total cost. Or is it somehow possible that a PVC is shared between namespaces?

the-it commented 7 months ago
Pokom commented 7 months ago

Could we also just have one metric for each PVC, just cost per hour. If we need to scrape all PVCs, we also know there size, then we also know there total cost. Or is it somehow possible that a PVC is shared between namespaces?

next question is this part of the GKE module?

I'll have a better answer to both questions once I start the implementation. It might end up being a dedicated module, but persistent volumes in particular are directly related to k8s resources so I think gke is where I'm going to start.

I like the notion of a single metric which takes into account exactly how much that pvc costs per hour as it simplifies things down stream in terms of queries. As long as there's no technical blocker, that's how I'll roll this out.

Pokom commented 2 months ago

Closing in favor of using existing issues. AWS is being implemented by @paulajulve(https://github.com/grafana/deployment_tools/issues/149203), and Azure still has to be planned out and picked up.