grafana / mimir-prometheus

Apache License 2.0
35 stars 9 forks source link

TSDB: improve debug logging in compaction #677

Closed bboreham closed 2 months ago

bboreham commented 2 months ago

While diagnosing https://github.com/prometheus/prometheus/pull/14584, the logging of chunks found to be out-of-order during ingester head compaction was lacking some useful information such as series labels.

If the chunks are safeHeadChunk it would print labels, but in the case I analyzed they were ordinary mmapped chunks. So, this PR makes it log the labels that PopulateBlock has.

Refactor slightly to avoid logging blanks where information is unavailable.

(This function is only in mimir-prometheus, not upstream)