Cortex
By CNCF
Cortex is an open-source, horizontally scalable project that turns Prometheus-style metrics into a multi-tenant, long-term storage service, offering Prometheus-as-a-service so many teams or clusters can share one centrally operated metrics…
Definition
Cortex is an open-source, horizontally scalable project that turns Prometheus-style metrics into a multi-tenant, long-term storage service, offering Prometheus-as-a-service so many teams or clusters can share one centrally operated metrics backend instead of each running its own server. It exposes the same PromQL query language and Prometheus remote-write ingestion path, letting existing tooling connect without modification, and is hosted as a Cloud Native Computing Foundation project used by organizations that have outgrown single-node Prometheus deployments.
Overview
Prometheus was designed to run as a single self-contained server scraping and storing metrics on local disk, a model that works well per-cluster but does not natively support long-term retention, global querying across many instances, or serving multiple isolated tenants from shared infrastructure. Cortex was built to fill that gap, originally at Weaveworks, by wrapping Prometheus's data model and query engine in a horizontally scalable, distributed system that can ingest from hundreds of Prometheus servers and store years of data cheaply in object storage. Cortex's architecture splits responsibilities across several components: distributors accept incoming samples and hash them across a ring of ingesters, which buffer recent metrics before flushing immutable blocks to object storage; queriers then fan out across those blocks and any still-buffered data to answer PromQL queries, using a compactor to periodically merge and deduplicate stored blocks. A ring-based consistent-hashing mechanism, borrowed from Dynamo-style distributed systems, is what lets Cortex add or remove nodes without losing data or requiring a full rebalance. Multi-tenancy is enforced at the API layer, where every request carries a tenant ID that scopes both storage and query access. Cortex sits alongside Mimir, which was forked directly from its codebase by Grafana Labs and has since diverged with its own optimizations, and Thanos, which achieves similar long-term storage and global-query goals through a different sidecar-based architecture rather than Cortex's ingest pipeline. Compared to a single Prometheus instance, Cortex trades operational simplicity for scale and multi-tenancy; compared to commercial all-in-one platforms like Datadog, it remains a metrics-only, self-hosted building block that still needs a visualization layer such as Grafana on top. In practice, Cortex has been used by platform teams and observability vendors that need to offer Prometheus-compatible metrics as a service to many internal or external tenants, such as a company operating shared Kubernetes infrastructure for several product teams. Prometheus instances remote-write into Cortex, Grafana or another PromQL-aware tool queries it for dashboards, and tenant isolation lets each team see only its own data and stay within its own configured limits. The main limitation is that Cortex, like Mimir, involves running and tuning several distinct microservices, which is considerably more operational overhead than a single Prometheus binary and is only worthwhile once retention, scale, or multi-tenancy requirements outgrow what one server can do. Since Grafana Labs' continued investment now goes primarily into Mimir, many new deployments choose Mimir over Cortex for feature parity and momentum, while Cortex remains relevant for existing installations and organizations that value its longer track record and current CNCF governance.
Key Features
- Delivers Prometheus-compatible, horizontally scalable metrics storage
- Supports multi-tenant deployments with isolated data per tenant
- Uses a distributor-ingester-querier pipeline for scalable ingestion and reads
- Stores historical data in object storage for long-term retention
- Implements consistent hashing via a ring for elastic scaling
- Is fully compatible with PromQL and Prometheus remote-write
- Operates as a CNCF-hosted, community-governed open-source project
- Serves as the architectural ancestor of Grafana Mimir