Lifecycle of a Sample in the Prometheus TSDB
summary
Prometheus TSDB stores each sample as int64 timestamp + float64 value, writes every mutation to a Write-Ahead Log (WAL) for crash durability, compresses on the fly into chunks with gorilla compression, memory-maps head-chunk files, and compacts the head into persistent two-hour blocks and then merges three blocks into one for query efficiency. Tombstones mark deletions until block deletion by retention; checkpoints and replay restore state, and shutdown snapshots make startup >50% faster.
AI-written summary · about
chapters (20)
- 0:00Introduction
- 1:13Prometheus Architecture
- 2:03Head Block
- 2:54Chunk
- 4:04RightHeadLog
- 4:45Why Write a HeadLog
- 5:12HeadLog Example
- 7:17Why do we need head compaction
- 7:50Bigger blocks
- 8:02Older blocks
- 8:17Grouping blocks
- 8:43Block compaction
- 10:13Block
- 12:55Index
- 16:43Query
- 18:46Query Multiple Blocks
- 20:41Tombstones
- 22:42Replay
- 23:51Maintenance
- 28:08Snapshot
related talks
36mPrometheus - Intro, Deep Dive, And Open Q+A
23mPrometheus – What it is, What is New, and What is Coming
30mTSDB: The Past, Present and the Future - Goutham Veeramachaneni, IIT Hyderabad
37mPrometheus Deep Dive
33mPrometheus Project Intro
33mIntro: Prometheus
01h 19mIntro + Deep Dive: Prometheus
28mIntegrating Long-Term Storage with Prometheus [A]
