Interview Prep/Monitoring & Observability/Prometheus storage, memory and cardinality

Compaction fails with `compaction failed ... overlapping blocks`

AdvancedTroubleshootingPrometheus storage, memory and cardinality
Answer

Likely causes → Blocks with overlapping time ranges, often from backfilling with promtool tsdb create-blocks-from or copying blocks from another instance.

Diagnose →

promtool tsdb list /prometheus

Look for blocks whose MinTime/MaxTime ranges overlap.

Fix → Vertical compaction handles overlaps in Prometheus 2.39+ by default. On older versions, remove or move the overlapping backfilled blocks and re-backfill into non-overlapping windows.

Prevent → Backfill into a staging directory, validate with promtool tsdb analyze, then move blocks in.

All Monitoring & Observability questions Roadmap: Monitoring & alerting

More on Prometheus storage, memory and cardinality