Prometheus Storage and Retention
Cheat sheet · https://pcornel.dk/topic.php?topic=6218
Answer
Prometheus stores data in a local TSDB (head block in memory + WAL, then 2-hour blocks compacted) with retention by time or size; long-term storage uses remote_write to Thanos, Mimir or similar.
Remember
Memory is driven by active series. Set --storage.tsdb.retention.time or .size. Local storage is single-node — use remote_write for HA and long retention.
First checks
curl -s localhost:9090/api/v1/status/tsdb— first check for this topiccurl -s localhost:9090/-/ready— Prometheus readycurl -s 'localhost:9090/api/v1/query?query=up'— scrape targets up/downpromtool check config prometheus.yml— config valid
Verify in this order
samples → head/WAL → blocks → compaction → retention/remote
Where it usually breaks
High-cardinality metrics exhaust memory before disk.
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=6218