opencost / opencost

Cost monitoring for Kubernetes workloads and cloud costs
http://opencost.io
Apache License 2.0
4.76k stars 512 forks source link

Multi Cluster observability #2638

Open OliverChmelicky opened 2 months ago

OliverChmelicky commented 2 months ago

Multi Cluster feature request Would there be a way in the future how to monitor costs in multiple GCP GKE clusters? Theoretically would it be possible to monitor multiple clusters from multiple Cloud Providers?

Final solution See in one Opencost view costs pivoted per Cluster, per Project or per Cloud provider if possible.

Alternatives An alternative would be to configure Prometheus to collect metrics from different clusters in the same project or multiple projects but still using one Cloud Provider. I am not sure whether there would be an option in Opencost UI to see costs aggregated per Cluster. But per Node they should be easy to separate even in the actual implementation.

mattray commented 2 months ago

The most straightforward solution would be to use Prometheus forwarding sidecars to a centralized Prometheus-compatible database (Thanos, Mimir, etc.) and run Grafana against that. That's been independently implemented multiple times but it's not documented.

The OpenCost UI doesn't support that and you'd need some sort of API on top of that. But if all you want is basic observability, what I described above works.