Thanos vs Cortex

Published
Length
3 min read

Luis Felipe Dias

All posts

The main difference in thanos vs cortex is how each tool collects and stores metrics. Teams pick Thanos for sidecar storage and choose Cortex for central push ingestion. Both open-source projects help engineering teams scale Prometheus across many clusters. They solve two big problems: global query views and long-term metric storage. Without them, a single Prometheus server runs out of disk and memory fast. You can run either tool to keep years of metric data in object storage. Core architect

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

The main difference in thanos vs cortex is how each tool collects and stores metrics. Teams pick Thanos for sidecar storage and choose Cortex for central push ingestion.

Both open-source projects help engineering teams scale Prometheus across many clusters. They solve two big problems: global query views and long-term metric storage. Without them, a single Prometheus server runs out of disk and memory fast. You can run either tool to keep years of metric data in object storage.

Core architecture in thanos vs cortex

Thanos uses a pull model that builds right on top of your existing Prometheus servers. You run a small sidecar process next to each Prometheus instance in your clusters. This sidecar reads local metric blocks and uploads them to cloud object storage. A central query component then pulls live data from sidecars and old data from storage. This design lets each cluster keep working even if the central network goes down. Teams with independent clusters often prefer this modular setup.

Cortex uses a push model where Prometheus servers send metrics to a central cluster. Each Prometheus server uses its remote write feature to stream samples as they happen. Cortex splits its work across several small services that scale on their own. Incoming data hits distributor nodes first and then moves to ingester nodes in memory. The ingesters batch the samples and write them to long-term storage later. This setup works well when you run a shared platform for many teams.

Query performance also differs between the two tools during daily work. Thanos queries reach out to edge clusters for recent data and object storage for history. Cortex keeps recent data inside its central ingester memory for fast reads. Both systems can split big queries across many worker nodes to speed up results. Your choice depends on whether you want edge control or central management.

Tradeoffs, boundaries, and runtime session controls

Thanos is often easier to add to clusters that already run Prometheus today. You do not need to change how your local apps scrape metrics at first. Still, managing sidecars across hundreds of small clusters can become hard work over time. If a sidecar fails, that cluster misses out on global query results until fixed.

K8s RBAC Role vs ClusterRole + Thanos Security: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Cortex gives you strong multi-tenant isolation out of the box for large groups. You can set strict rate limits so one noisy app cannot break the whole system. The tradeoff is that running the central Cortex services takes more initial setup work. If the central ingestion path goes down, edge servers must buffer data on disk.

Both tools store sensitive operational metrics and labels that need strong security rules. Static role setups in your cloud account only guard the base storage buckets. Engineers still need safe ways to run ad-hoc queries and check live cluster state. Pairing your metric stack with runtime session controls helps teams audit every query action. When sensitive labels like emails or phone numbers appear, masking rewrites matched fields in results.

Add runtime guardrails and masking beside your databases and APIs

Login rules, role grants, and CI checks govern who connects to your stack. Yet any allowed script, engineer, or AI agent still runs commands with the full scope of its role. For workloads on Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes, SSH, or internal HTTP services, hoop.dev sits beside the service as an open-source proxy, a sidecar for your database or API.

Before a query runs, hoop.dev guardrails check the statement against your rules. An AI Analyzer you configure can score intent or hold risky calls for human review. Next, hoop.dev data masking rewrites sensitive fields in responses, and each verdict is logged per listener. Explore the MIT-licensed project on GitHub.

Frequently asked questions

Can Thanos use remote write like Cortex does?

Yes, Thanos now includes a receive component that accepts Prometheus remote write streams. This lets teams mix sidecar pulls and push ingestion in the same setup.

Which tool is better for multi-tenant metric isolation?

Cortex was built from day one to isolate data and queries between different tenants. Thanos can support multiple tenants too, but it takes more manual setup work.

What kind of storage do Thanos and Cortex need?

Both tools work best with standard cloud object storage for long-term metric blocks. Cortex used to need NoSQL databases, but it now supports pure block storage too.

The query runs. The emails stay hidden.