data/chunk_snapshot.000005.000123/
Memory Snapshot
On clean shutdown (with --enable-feature=memory-snapshot-on-shutdown)
Prometheus dumps the head block's in-memory state into a
chunk_snapshot.X.Y directory using the WAL package: each
structure below is the payload of one WAL record. On restart, replaying this snapshot plus the
m-mapped head chunks is much faster than a full WAL replay.
Record order is fixed: all series records first (unsorted), then exactly one tombstones record, then exemplar records batching the exemplar circular buffer in write order.
Open the interactive byte explorer →
Field notes & invariants
- Record types (from
head_wal.go): 1 series, 2 tombstones, 3 exemplars. - The series record carries the open (not yet m-mapped) head chunk inline, plus
sampleBuf(the last 4 samples), needed to re-prime the appender's delta/XOR state. Chunk Existsis 1 only if the series currently has an open head chunk; when 0, every following chunk field is absent.- The tombstones payload reuses the block tombstones encoding (version byte + stones), length-prefixed.
- Exemplar rows use the WAL exemplar encoding with delta-encoded refs/timestamps against the first row.
- The framing around each payload (type/len/CRC) is the standard WAL record framing; see the WAL page.