Calculate how long Prometheus can retain metrics given available disk space.
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.
required_storage_GB = daily_ingestion_GB × retention_days × (1 + compaction_overhead)
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.
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.
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.
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.