Skip to content
DevOps AI ToolKit
Newsletter
All guides
AI for Prometheus & Monitoring By James Joyner IV · · 9 min read

Long-Term Prometheus Storage: Thanos vs Mimir, Explained

Prometheus keeps weeks of data, not years. Here's how Thanos and Mimir give you durable, queryable, long-term metrics — and how to choose.

  • #prometheus
  • #thanos
  • #mimir
  • #storage
  • #observability
  • #monitoring

Vanilla Prometheus is a brilliant short-term database and a terrible long-term one. It keeps a couple of weeks of data on local disk, it’s a single point of failure, and it can’t show you a unified view across twenty clusters. The moment someone asks “how did latency trend over the last six months?” or “what’s the global error rate across all regions?”, you need something more. That something is usually Thanos or Mimir. After running both, here’s how they work and how to choose.

Why plain Prometheus isn’t enough

Three limits push people past single-node Prometheus:

  • Retention. Local TSDB defaults to ~15 days. Storing years locally is expensive and fragile.
  • High availability. One Prometheus is a single point of failure. Run two and now you have two slightly different answers and no unified query.
  • Global view. With many Prometheus servers (one per cluster/region), there’s no single place to query across all of them.

Both Thanos and Mimir solve all three by pushing data to cheap object storage (S3, GCS, Azure Blob) and putting a query layer in front. The blocks Prometheus writes every two hours get shipped to a bucket and kept as long as you like, for the price of object storage.

How Thanos works

Thanos is a set of components you bolt onto your existing Prometheus servers. The key pieces:

  • Sidecar — runs next to each Prometheus, uploads its 2-hour TSDB blocks to object storage, and exposes the Prometheus’s recent data to queries.
  • Store Gateway — serves the historical blocks back from object storage at query time.
  • Querier — a stateless component that fans a single PromQL query out to all sidecars and store gateways, deduplicates results from HA pairs, and merges them. This is your global view.
  • Compactor — compacts and downsamples old blocks so long-range queries stay fast and cheap.

The mental model: keep your Prometheus servers, add a sidecar to each, and put a Querier on top that makes them look like one giant Prometheus. It’s additive — you don’t rip out what you have.

# Thanos sidecar, conceptually
- --tsdb.path=/prometheus
- --objstore.config-file=/etc/thanos/bucket.yaml
- --prometheus.url=http://localhost:9090

How Mimir works

Grafana Mimir takes the opposite approach: it’s a single, horizontally-scalable system that Prometheus remote-writes into. Your Prometheus servers stop being the source of truth and become lightweight scrapers that forward samples to Mimir.

# Prometheus remote_write to Mimir
remote_write:
  - url: http://mimir-distributor/api/v1/push

Mimir is built from microservices — distributor, ingester, querier, store-gateway, compactor — that scale independently. It’s a descendant of Cortex, designed for very large, multi-tenant deployments. You get built-in horizontal scaling, multi-tenancy, and a query path engineered for billions of active series.

The real difference in one paragraph

Thanos federates your existing Prometheus servers; Mimir centralizes everything into a purpose-built cluster. Thanos lets each Prometheus keep doing its job and stitches them together with a sidecar and a querier — lower friction if you already run many Prometheus instances and want to keep them. Mimir asks you to remote-write into a central system — more moving parts to operate, but more horizontal headroom and cleaner multi-tenancy at extreme scale.

How to choose

I pick based on a few honest questions:

  • Do you already run many Prometheus servers and like that? Thanos slots in with minimal disruption.
  • Are you operating at genuinely huge scale or need hard multi-tenancy? Mimir was built for that.
  • How much operational complexity can you carry? Both add components; Mimir’s microservice topology is more to run. Don’t take it on for ten million series you could serve with a Thanos sidecar.
  • What does your team already know? A system your people understand beats a “better” one they don’t.

For most teams growing past one Prometheus, Thanos is the gentler on-ramp. For a platform team standardizing metrics for the whole company, Mimir’s centralization often wins. Neither is wrong; they’re different shapes of the same solution.

Downsampling matters more than you think

A query over six months at full resolution scans an enormous amount of data. Both systems downsample old blocks — storing 5-minute and 1-hour resolution alongside the raw data — so a long-range graph reads the coarse data and stays fast. Make sure downsampling and a compaction schedule are configured; without them, long-range queries get slow and expensive exactly when you want history.

Don’t forget retention policy

Object storage is cheap, not free. Set retention per resolution: maybe raw data for 30 days, 5-minute downsampled for 6 months, 1-hour for two years. This keeps the bill sane while preserving the long-term trends people actually query. Decide it deliberately rather than defaulting to “keep everything forever.”

Where AI helps

These deployments are configuration-heavy, and the components have a lot of interacting flags. I lean on AI to draft the initial component configs — sidecar flags, remote-write tuning, compactor and retention settings — and to explain what a given flag actually does when the docs are terse. It’s also good for sanity-checking a topology: “here’s my Thanos setup, what’s missing for HA dedup?”

You verify everything against the real docs and your environment, but it shortens the ramp considerably. We keep monitoring prompts for storage architecture, and the recording rules our Alert Rule Generator produces work the same whether they run on plain Prometheus, Thanos, or Mimir.

The bottom line

You will outgrow single-node Prometheus the day someone needs history or a global view. Thanos and Mimir both fix retention, HA, and the global query — the difference is federation versus centralization. Pick the one that fits how you already run things and how much complexity you can operate, configure downsampling and retention, and you’ll have metrics you can trust for years, not weeks.

Architecture and config recommendations here are assistive, not authoritative. Always validate against current Thanos/Mimir documentation and test in staging before relying on long-term storage in production.

Free download · 368-page PDF

Download the Free 500-Prompt DevOps AI Toolkit

500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.

  • 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
  • Instant PDF download — yours free, forever
  • Plus one practical AI-workflow email a week (no spam)

Single opt-in · unsubscribe anytime · no spam.