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

Thanos Compactor logs `critical error detected; halting` and stops compacting

AdvancedTroubleshootingPrometheus storage, memory and cardinality
Answer

Likely causes → Overlapping blocks in the bucket (two sidecars with identical external labels), or a corrupt block.

Diagnose →

thanos tools bucket verify --objstore.config-file=bucket.yml
thanos tools bucket inspect --objstore.config-file=bucket.yml

Check thanos_compact_halted == 1.

Fix → Give each Prometheus unique external_labels (including replica), mark the bad block with thanos tools bucket mark --marker=no-compact-mark.json or delete it, then restart the compactor. Use --deduplication.replica-label=replica.

Prevent → Alert on thanos_compact_halted, and run exactly one compactor per bucket.

All Monitoring & Observability questions Roadmap: Monitoring & alerting

More on Prometheus storage, memory and cardinality