Skip to content
ENExplore Calculators

Prometheus Retention Calculator

Calculate how long Prometheus can retain metrics given available disk space.

About Prometheus Retention Calculator

Prometheus retention and disk usage are directly proportional to daily storage growth: days_at_size = disk_GB ÷ daily_growth_GB, or inversely, disk_needed = days × daily_growth_GB. Daily growth depends on active series count, scrape interval, and sample size after compression — measure it directly from `prometheus_tsdb_storage_blocks_bytes` growth over a day rather than estimating from scratch when possible.

Formula

required_storage_GB = daily_ingestion_GB × retention_days × (1 + compaction_overhead)

daily_ingestion_GB
Daily TSDB data ingested (GB)
retention_days
Configured retention period (days)
compaction_overhead
TSDB compaction overhead factor

Worked example

With the default values below, Prometheus Retention Calculator returns Retention Window of 111.1. Change any input above and every figure here is recalculated in your browser.

Inputs used

Solve Forone of Days of retention from available disk, Disk needed for a target retention
Days of retention from available disk
Available Disk Spaceaccepts 0–1,000,000 GB
500 GB
Target Retentionaccepts 1–3,650 days
90 days
Daily Storage Growthaccepts 0.001–100,000 GB/day
4.5 GB/day

Results

Retention Window
111.1 days
Disk Space
500.0 GB
Days at Available Disk
111.1 days
Disk Needed for Target Retention
405.0 GB

Step by step

  1. 1Days at available disk: disk ÷ daily growth= 111.1 days
  2. 2Disk for target retention: days × daily growth= 405.0GB
  3. 3Selected mode result= 111.1 days

Assumptions and limits

  • The result is derived only from the 4 inputs listed above. Anything not among them is not part of the calculation.
  • In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
  • Figures are rounded for display to 1 decimal place, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.

How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.

Frequently Asked Questions

How do I measure my actual daily growth rate?

Query `rate(prometheus_tsdb_storage_blocks_bytes[1d])` or simply compare TSDB directory size across two days — this gives a real, compression-adjusted growth rate rather than a theoretical estimate.

Does Prometheus retention delete data exactly at the configured limit?

Prometheus deletes whole 2-hour (and later, larger compacted) blocks once they age past the `--storage.tsdb.retention.time` setting, so actual retention can be slightly longer than configured until the next compaction/cleanup cycle runs.

Should I set a retention.size limit too?

Yes — `--storage.tsdb.retention.size` acts as a hard disk cap that takes precedence over the time-based limit, which is a good safety net against unexpected cardinality growth filling the disk unexpectedly.

What if I need longer retention than local disk allows?

Use remote_write to a long-term storage backend (Thanos, Cortex, Mimir, or a managed TSDB) and keep local Prometheus retention short (e.g. a few hours to a couple days) purely as a write buffer.

Prometheus Retention Calculator | Calcrivo