Prometheus Retention Calculator
Calculate how long Prometheus can retain metrics given available disk space, or the disk needed for a target retention window.
Inputs
Choose which value to calculate.
Disk space allocated to the Prometheus TSDB.
How much TSDB disk usage grows per day at your current scrape volume.
Retention Window
111.1days
Disk Space
500.0GB
Days at Available Disk
111.1days
Disk Needed for Target Retention
405.0GB
Step by step
Days at available disk: disk ÷ daily growth
500GB ÷ 4.5GB/day
= 111.1 days
Disk for target retention: days × daily growth
90 × 4.5GB/day
= 405.0GB
Selected mode result
days of retention at available disk
= 111.1 days
How it works
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
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.