2026 Guide: Setting Retention and Storage Tiers for Metrics



Every metric data point you record has a cost. Not just the cost of ingesting it, but the cost of storing it, indexing it, and keeping it queryable for however long you decide it should live. Setting retention and storage tiers for metrics is the practice of defining those boundaries: how long data persists, at what resolution, and on what kind of storage infrastructure.

Most teams treat this as an afterthought. They accept defaults, watch storage bills climb, and only revisit the question after a cost spike forces them to. That’s backward. Retention is a first-class architecture decision that should happen early, get automated, and be reviewed quarterly.

This guide explains what retention and storage tiers mean, how they work across self-hosted and managed systems, and how to choose the right settings for your situation.

Compare Distlang plan tiers to see how retention maps to each pricing level.


What Metrics Retention Means

Retention is the duration that metric data points persist before the system deletes them. When your monitoring tool says “15-day retention,” it means any data older than 15 days gets purged automatically.

There are two flavors:

Time-based retention sets a clock. Data older than X days disappears. This is the most common approach. Prometheus, for example, defaults to 15 days if you don’t configure anything.

Size-based retention sets a storage cap. When total storage exceeds Y gigabytes, the oldest data gets deleted first, regardless of age. Prometheus supports this via the --storage.tsdb.retention.size flag.

The safest production setup combines both. Time-based retention gives you predictable history windows, while size-based retention acts as a safety net against unexpected cardinality explosions or ingestion spikes.

Why unbounded retention is dangerous

Without explicit retention settings, storage grows indefinitely. Queries slow down as the dataset expands. And costs compound, because observability cost is a function of three variables multiplied together:

Volume × Cardinality × Retention = Total Cost

This formula is the single most important mental model for understanding observability spending. Volume is how many data points you ingest per second. Cardinality is how many unique time series those labels create. Retention is how long you keep it all. Increase any one variable and costs go up. Increase all three without limits and you get the runaway storage bills that 96% of organizations are now actively trying to reduce.

Understanding the types of metrics you’re collecting (counters, histograms, gauges) helps you make smarter decisions about which data justifies long retention and which doesn’t.


What Storage Tiers Are

Storage tiers organize data by access frequency and performance requirements. The standard model uses three or four levels:

Hot tier

Recent, full-resolution data stored on fast media (SSDs or high-performance cloud storage). This is where your real-time dashboards and alerting queries run. Typical retention: 1 to 14 days.

Hot storage is expensive per gigabyte but delivers the sub-second query latency that incident response demands.

Warm tier

Data that’s still queryable but accessed less frequently. Think of it as the range you’d use for weekly reports or investigating an issue from last month. Typical retention: 30 to 90 days. Storage medium: high-capacity HDDs or standard cloud object storage.

Cold and frozen tiers

Rarely accessed data kept for compliance, audit trails, or long-term trend analysis. Retention can stretch from months to years. Storage is the cheapest available, often cloud object stores like S3, GCS, or Azure Blob. Query latency is significantly higher, sometimes minutes rather than seconds.

The key insight: data doesn’t need to maintain the same resolution as it moves between tiers. That’s where downsampling comes in.

Downsampling: the mechanism that connects tiers

Downsampling reduces the granularity of older data. You might keep per-second resolution for the last week, per-minute resolution for the last three months, and per-hour resolution for everything beyond that.

Netdata’s default configuration illustrates this well. With an ingestion rate of about 4,000 metrics per second, Netdata provides roughly 14 days of per-second data, 3 months of per-minute data, and over a year of per-hour data.

A critical misconception: many teams assume downsampling saves storage space. It often doesn’t. Thanos documentation is explicit about this. Downsampling creates additional blocks with various aggregations (min, max, sum, count) to ensure mathematical correctness. If you store all resolutions, total storage can increase by roughly 3x. The primary benefit of downsampling is faster query performance on historical data, not smaller storage footprints.


How Retention Works in Self-Hosted Systems

If you run your own monitoring infrastructure, setting retention and storage tiers for metrics means configuring specific flags, compaction settings, and sometimes entirely separate storage backends.

Prometheus

Prometheus stores data in a local time-series database (TSDB). The two key flags are:

  • --storage.tsdb.retention.time=30d (how long to keep data)
  • --storage.tsdb.retention.size=50GB (maximum storage footprint)

An important limitation: Prometheus local retention applies at the TSDB level, not per metric name. You cannot tell Prometheus to keep http_requests_total for 90 days while keeping debug_verbose_metric for only 3 days. Everything shares one retention window. This is a meaningful constraint that pushes teams toward external long-term storage solutions.

For instrumenting metrics in production, understanding these retention boundaries helps you design metric schemas that make the most of your available history.

Thanos

Thanos extends Prometheus with a three-resolution retention model that has become a reference pattern across the industry:

  • Raw resolution (typically 30-second samples): retained for ~30 days
  • 5-minute downsampled: retained for ~90 days
  • 1-hour downsampled: retained for 365 days or indefinitely

Thanos creates 5-minute downsampled blocks once raw blocks are older than 40 hours, and 1-hour downsampled blocks once 5-minute blocks are older than 10 days.

Real-world numbers from GitLab’s Thanos deployment show the scale implications. They keep raw samples for 365 days, 5-minute samples for 5 years, and 1-hour samples forever. Their production bucket reached approximately 314TB in size. This is what happens when an organization decides it needs deep history, and it demonstrates why retention settings require deliberate planning rather than optimistic defaults.

Grafana Mimir

Mimir stores metrics in object storage and supports per-tenant retention through its compactor configuration. By default, stored metrics are never deleted, and utilization just grows over time. You configure retention periods to auto-delete data older than a specified window.

One notable limitation: Grafana Mimir doesn’t support per-series deletion and retention. Like Prometheus, retention is global or per-tenant, not per-metric.

Pipedrive’s experience with Mimir illustrates the infrastructure demands of even modest retention. With a retention policy of only 30 days, they’re storing around 20 million time series, requiring roughly 600GB of memory, 150 CPUs, and 5TB of S3.

Netdata

Netdata’s dbengine uses three built-in tiers automatically. Tier 0 stores per-second data, Tier 1 stores per-minute aggregations, and Tier 2 stores per-hour aggregations. The system manages transitions between tiers without manual compaction or additional tools.


How Retention Works in Managed and Serverless Services

For a growing number of developers, especially those building on Cloudflare Workers, Vercel, or similar serverless platforms, running a TSDB is neither practical nor desirable. There’s no persistent storage in a short-lived handler. There are no long-running processes to attach a Prometheus sidecar to. The observability infrastructure has to live somewhere else.

In managed services, setting retention and storage tiers for metrics is a plan-selection problem, not an infrastructure problem. You pick a pricing tier, and retention comes bundled with it.

This is a fundamentally different model. As ClickHouse’s engineering team has observed, many systems rely on SSD-backed storage for query performance, and combined with poor compression, this makes long-term retention costly. Costs are either absorbed by the vendor or passed on, forcing end users to treat retention as a budgeting problem.

Typical managed service retention windows follow a predictable pattern:

  • Free tiers: 7 days
  • Entry-level paid: 7 to 14 days
  • Mid-tier: 30 days
  • Enterprise: 90+ days

Distlang Metrics follows this pattern. The Free and Launch plans include 7-day retention. The Hobby plan extends to 14 days. The Growth plan provides 30 days. No TSDB configuration required, no compactor tuning, no object storage buckets to manage.

Get started with Distlang Metrics in minutes, with retention handled automatically by your plan.

This simplicity matters. Serverless developers dealing with flush semantics and short-lived handler lifecycles already have enough to think about. Retention should be a line item on a pricing page, not a week-long infrastructure project.

The hidden cost of infinite retention in serverless

One of the most common mistakes in serverless environments is leaving log retention set to infinite. Practitioners in the FinOps community consistently flag this as a silent budget killer. Setting a 7 to 14 day retention policy on all Lambda log groups (or equivalent) is a low-effort change with immediate savings. The same principle applies to metrics: if nobody queries data older than two weeks, paying to store it is waste.


Choosing the Right Retention Period

The right retention period depends on one question: when will you actually query this data?

Development and staging: 3 to 7 days

Three days is usually sufficient for dev environments. You need to see recent behavior and debug current issues, but you won’t analyze staging metrics from last quarter. Keeping retention short here saves money and keeps your metric stores clean.

Production monitoring and alerting: 14 to 30 days

Most production queries target recent data. Research consistently shows that the majority of observability data is queried within its first two weeks after ingestion. A 14-day window covers most incident investigations and short-term debugging. Extending to 30 days gives additional room for week-over-week comparisons and sprint-level trend analysis.

For teams running a lightweight monitoring setup for an MVP, 14 days is a practical starting point that balances visibility with cost.

Capacity planning and trend analysis: 30 to 90 days

If you’re tracking growth patterns, doing seasonal comparisons, or planning infrastructure scaling, you need longer windows. This is where warm-tier storage and downsampling earn their keep. Per-minute resolution over 90 days gives you meaningful trendlines without the cost of full-fidelity data.

Compliance and regulated industries: months to years

Finance, healthcare, and government workloads sometimes mandate metric retention of 1 to 5 years or longer. Almost always, this data is downsampled and stored in cold or frozen tiers. The data exists for audit and forensic purposes, not real-time querying.

OpenStreetMap provides an interesting case study at the other end of the spectrum. They increased their Prometheus retention from 30 days to approximately 540 days (18 months), showing that some organizations have genuine long-term analysis needs even outside compliance mandates.


Common Mistakes When Setting Retention and Storage Tiers for Metrics

Accepting defaults without evaluation

Prometheus defaults to 15 days. Grafana Mimir defaults to never deleting anything. Both are wrong for most teams. One is too short for production trend analysis, and the other is a storage time bomb. Evaluate your actual query patterns before deploying.

Storing full-fidelity data longer than necessary

Keeping per-second resolution for 90 days sounds thorough. In practice, nobody queries three-month-old data at one-second granularity. Downsample aggressively for anything beyond your hot tier. Practitioners report that most teams can reduce metric data point volume by 50 to 75% through downsampling without any impact on alerting or dashboarding.

Ignoring cardinality as a cost multiplier

Retention gets all the attention, but high cardinality is often the bigger cost driver. A metric with 10,000 unique label combinations retained for 30 days costs as much as a metric with 1,000 combinations retained for 300 days. Review your low-cardinality label strategies before extending retention.

Treating all signals the same

Not all observability data deserves equal retention. Retain high-fidelity traces for a shorter period (hours to days) while archiving aggregated metrics for longer-term analysis. The MELT framework (metrics, events, logs, traces) is useful here because each signal type has different retention economics.

Assuming “set it and forget it” works

Workloads change. New services get deployed. Cardinality creeps upward. Setting retention policies isn’t a one-time task. Monitoring your retention settings, specifically disk utilization, ingestion rate, and query latency, helps ensure policies stay aligned with actual needs. Review quarterly at minimum.

Not combining time and size retention

Using only time-based retention leaves you vulnerable to storage spikes from cardinality explosions. Using only size-based retention means unpredictable history windows. Combine both for the safest production setup.


Quick-Reference: Retention Approaches Across Tools

Tool Default Retention Tiering Model Per-Metric Retention Best For
Prometheus 15 days Single tier (local TSDB) No (global only) Short-term, self-hosted
Thanos Configurable per resolution Three resolutions (raw, 5m, 1h) No Long-term self-hosted with object storage
Grafana Mimir Infinite (no auto-delete) Object storage with per-tenant overrides No Multi-tenant, large-scale self-hosted
Netdata ~14d high-res, ~3mo mid, ~1yr low Three automatic tiers No Infrastructure monitoring with built-in tiering
Distlang Metrics 7d (Free/Launch), 14d (Hobby), 30d (Growth) Plan-based, fully managed Plan-level Serverless/edge developers, no infra to manage

For serverless and edge workloads, simpler retention models win. If you’re running Cloudflare Workers or Vercel functions, configuring Thanos compactors is the wrong use of your time. A managed service with plan-based retention handles this complexity for you.

Explore cost optimization techniques for managed metrics plans to get the most from your retention budget.


Putting It All Together

The median observability team overspends by 30 to 60 percent. The four highest-impact cost strategies (log sampling, metric cardinality reduction, APM sampling, and retention tiering) typically combine for 35 to 55 percent savings in a single quarter.

Here’s a practical starting sequence:

  1. Audit your current retention. What’s the actual setting? Is it a default you never changed?
  2. Check your query patterns. When was the oldest data point anyone queried in the last month?
  3. Set time-based retention to match your realistic query horizon, plus a buffer.
  4. Add size-based retention as a safety cap.
  5. Downsample non-critical metrics to 60-second resolution first. Measure the cost impact. Then selectively apply higher downsampling to reporting-only metrics.
  6. Review quarterly. New services, new metrics, new costs.

For self-hosted teams, this means configuring TSDB flags and compaction policies. For teams using managed services, it means picking the plan tier that matches their actual retention needs, not the one that sounds most comfortable.

See the full end-to-end example to go from app code to a working dashboard with plan-managed retention in minutes.


FAQ

What is the default retention period for Prometheus?

Prometheus defaults to 15 days if you don’t set either the --storage.tsdb.retention.time or --storage.tsdb.retention.size flags. For most production environments, 15 days is too short for meaningful trend analysis. Self-hosted teams typically configure 30 to 60 days of local retention.

Does downsampling save storage space?

Not necessarily, and this is one of the most common misconceptions. Thanos, for example, creates additional blocks with multiple aggregations (min, max, sum, count, counter) to maintain mathematical correctness. If you store all resolutions alongside the originals, total storage can increase by roughly 3x. The primary benefit of downsampling is faster query performance on historical data.

Can I set different retention periods for different metrics?

In most tools, no. Prometheus applies retention at the TSDB level, not per metric name. Grafana Mimir supports per-tenant retention but not per-series retention. If you need different retention windows for different metrics, you typically need to route them to separate storage backends or tenants.

How much can retention tiering save on observability costs?

Keeping full-fidelity data hot for 7 to 14 days and moving older or downsampled data to cheaper storage typically cuts storage cost by 50% or more. Most observability data is queried within the first two weeks after ingestion, so paying for fast storage beyond that window is usually waste.

What retention period do serverless applications need?

For most serverless workloads, 7 to 14 days covers active debugging and incident investigation. Setting infinite retention on serverless logs or metrics is one of the most common hidden costs in serverless environments. Start with 7 days, extend to 14 or 30 if you have concrete use cases that demand it.

Should I use time-based or size-based retention?

Use both. Time-based retention gives you predictable history windows. Size-based retention acts as a safety net against unexpected ingestion spikes or cardinality explosions. Combining them is the recommended approach for production systems.

How does retention work in managed metrics services?

Managed services abstract retention into pricing tiers. Instead of configuring TSDB flags, you select a plan that includes a specific retention window. Distlang Metrics, for example, offers 7-day retention on Free and Launch plans, 14 days on Hobby, and 30 days on Growth. There’s no infrastructure to manage or compaction settings to tune.

How often should I review my retention settings?

At minimum, quarterly. Workloads change, new services launch, and cardinality tends to creep upward over time. A retention setting that was appropriate six months ago may now be causing unnecessary storage costs or, conversely, may be too short for the analysis patterns your team has adopted.