talira

Horizontally scalable, highly available, multi-tenant, long term storage solution for Prometheus and OpenTelemetry Metrics

open sourceApache-2.0self-hostablefree

Cortex is a clustered, multi-tenant backend that receives Prometheus remote write and OpenTelemetry (OTLP) metrics, keeps them in object storage (S3, GCS, Azure, Swift) and answers PromQL queries across recent and long-term data. It is built from separate services (distributor, ingester, querier, store gateway, compactor, plus an optional query frontend, ruler and multi-tenant Alertmanager) that scale out independently, and it can run as one binary for testing. Each tenant's data is isolated and limited separately, so one cluster can serve many teams or Prometheus servers. It is a CNCF incubating project under Apache-2.0; Grafana Labs forked it in 2022 to create Grafana Mimir, and the README lists Amazon Managed Service for Prometheus as a hosted offering.

Ways to install

Problems it solves

  • keep a year or more of Prometheus metrics in S3 instead of a few weeks on local disk
  • run one central metrics store that many Prometheus servers remote write into
  • give each team or customer its own isolated metrics with separate limits in a shared cluster
  • Prometheus is a single machine and we need metrics storage that keeps working when a node dies
  • query metrics from all our clusters in one place with PromQL from Grafana
  • deduplicate samples from a pair of HA Prometheus replicas before storing them
  • scale metrics ingestion horizontally as the number of active series grows
  • slow PromQL range queries over months of data need splitting and caching
  • send OpenTelemetry metrics over OTLP to a self-hosted backend that speaks PromQL
  • evaluate recording and alerting rules centrally for every tenant instead of on each Prometheus
  • run a multi-tenant Alertmanager for many teams from one deployment
  • build a Prometheus-as-a-service platform for internal teams on Kubernetes
  • delete all of one tenant's metrics when a customer leaves

Features

  • Prometheus remote write ingestion with Snappy-compressed protobuf
  • OTLP over HTTP ingestion, with experimental OTLP over gRPC
  • blocks storage based on Prometheus TSDB, kept in Amazon S3, Google Cloud Storage, Azure Storage, OpenStack Swift or a local filesystem
  • multi-tenancy with per-tenant TSDBs and limits, chosen by a tenant header on every request
  • replication across ingesters with consistent hashing
  • HA tracker that deduplicates samples from Prometheus HA pairs
  • query frontend that splits queries by time, caches results (memcached, Redis or in memory) and queues work
  • ruler for per-tenant recording and alerting rules
  • multi-tenant Alertmanager
  • compactor and store gateway for querying long-term blocks
View 3 more
  • tenant deletion API (experimental)
  • single binary mode for testing and microservices mode for production
  • Helm chart from the Cortex project

Limitations

  • Doesn't scrape targets itself: Prometheus or another agent scrapes them and sends samples to Cortex with remote write3
  • Doesn't authenticate requests itself: authentication and authorization are left to a reverse proxy in front of it3

Capabilities

Has an APIplan not known
Has a command line toolplan not known

Forks

  • Grafana Mimir Horizontally scalable, highly available, multi-tenant long-term storage for Prometheus. Its own project since 2022.

Alternatives

The same job

These do what Cortex does.

  1. Amazon Managed Service for Prometheus Serverless, Prometheus-compatible monitoring service for container metrics
  2. Thanos Open source, highly available Prometheus setup with long term storage capabilities
  3. Grafana Mimir Horizontally scalable, highly available, multi-tenant long-term storage for Prometheus
  4. VictoriaMetrics Fast, cost-effective and scalable time series database for monitoring, and long-term storage for Prometheus
  5. Backstage An open framework for building developer portals
  6. GreptimeDB The open-source observability database

Compare Cortex with the top 3