prometheus --storage.tsdb.retention.time=30d

Category: Monitoring & Observability

prometheus --storage.tsdb.retention.time=30d

Limit how long Prometheus keeps samples

Configures the retention window for samples in the TSDB (time series database); data older than 30 days is deleted in the background. Disk usage grows with retention, scrape frequency, and series count, so size the volume accordingly. Lower it on small disks and raise it when you need long-range queries.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.