OpenCost
A vendor-neutral CNCF specification and engine for real-time Kubernetes and cloud cost allocation.
- Category: Observability
- CNCF maturity: Incubating
- Language: Go
- License: Apache-2.0
- Repository: opencost/opencost
- Documented at commit:
4d117aa(develop, 2026-06-19)
What it is
OpenCost measures and allocates the cost of running workloads on Kubernetes. It runs inside the cluster, reads usage metrics from Prometheus, multiplies them by cloud provider pricing, and splits the result down to the namespace, pod, and controller level. It also pulls cloud billing data through a separate pipeline so out-of-cluster spend lands in the same model.
The project is two things at once: a written specification for how Kubernetes cost monitoring should work, and a reference implementation of that specification. The specification was drafted with Adobe, AWS, Google, Microsoft, New Relic, SUSE, Mindcurv, D2iQ, and Armory. The implementation is the cost allocation engine that also powers the commercial Kubecost product.
It sits in the observability layer next to Prometheus. OpenCost is a Prometheus consumer (it queries metrics) and a Prometheus producer (it exports its own cost metrics on /metrics), so it slots into an existing monitoring stack rather than replacing it.
When to use it
- You run workloads on Kubernetes and need per-namespace, per-pod, or per-controller cost breakdowns, not just a cloud bill at the account level.
- You want idle and shared costs attributed back to teams instead of left as an unexplained gap.
- You already run Prometheus and want cost data in the same place as the rest of your telemetry.
- You want a vendor-neutral, self-hosted, open-source baseline before committing to a commercial FinOps product.
It is a weaker fit when you only need account-level cloud billing with no in-cluster breakdown, where a cloud provider's native cost tool is simpler. It is also a weaker fit when you need multi-cluster aggregation, long-term retention, SSO, and alerting out of the box, which is where the commercial Kubecost upgrade or another FinOps platform fits.
In this deep-dive
- History: origin, milestones, and why it exists.
- Architecture: components and how requests flow.
- Adoption & Ecosystem: who runs it and what surrounds it.
- Internals: the code paths that matter, read from source.
- Getting Started: install and a first working setup.
Sources
- OpenCost Advances to CNCF Incubation (official blog)
- Apptio: Celebrating OpenCost's Journey to CNCF Incubation
- CNCF: OpenCost, a new CNCF Sandbox Project (2022-12-06)
- CNCF: OpenCost advances to the CNCF Incubator (2024-10-31)
- CNCF Projects: OpenCost
- Introducing OpenCost (official blog)
- GitHub: opencost/opencost
- ADOPTERS.MD at commit 4d117aa
- Grafana Labs: How Grafana Labs uses and contributes to OpenCost
- OpenCost README at commit 4d117aa
- OpenCost Documentation