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.
More on Prometheus storage, memory and cardinality
Prometheus pod restarts with `OOMKilled` every few hoursIntermediateA query fails with `query processing would load too many samples into memory in query execution`IntermediateHead series jumped from 2M to 9M after a deployAdvancedPrometheus logs `opening storage failed: ... unexpected EOF` / `corruption in segment` and won't startAdvancedPrometheus is in CrashLoopBackOff with `no space left on device`BeginnerPrometheus takes 15 minutes to become ready after a restartAdvanced