Skip to content

fix(compactor): correct misleading help text for cortex_compactor_garbage_collected_blocks_total#7673

Open
Goutham-Annem wants to merge 1 commit into
cortexproject:masterfrom
Goutham-Annem:fix/3610-compactor-gc-metric-help
Open

fix(compactor): correct misleading help text for cortex_compactor_garbage_collected_blocks_total#7673
Goutham-Annem wants to merge 1 commit into
cortexproject:masterfrom
Goutham-Annem:fix/3610-compactor-gc-metric-help

Conversation

@Goutham-Annem

Copy link
Copy Markdown

What this PR does:

The metric cortex_compactor_garbage_collected_blocks_total had an
identical help string to cortex_compactor_blocks_marked_for_deletion_total
("Total number of blocks marked for deletion by compactor."), which was
confusing and misleading. The two metrics track different things:

  • cortex_compactor_garbage_collected_blocks_total — counts blocks that the
    Thanos syncer's GC pass has actually garbage-collected (i.e., deleted after
    previously being marked). Sourced from Thanos pkg/compact/compact.go.
  • cortex_compactor_blocks_marked_for_deletion_total — counts blocks that
    Cortex's own logic has explicitly marked for deletion.

This PR corrects the help text to accurately describe what the metric
measures: "Total number of blocks garbage collected (deleted after being marked) by the compactor syncer." The test expectation is updated to match.

Which issue(s) this PR fixes:
Fixes #3610

Checklist

  • Tests updated (test expectation string updated to match new help text)
  • CHANGELOG.md updated
  • Documentation added (N/A — metric help text is self-documenting)

Note: This PR was developed with AI assistance (Claude Code).

…bage_collected_blocks_total

The metric counted blocks garbage collected by the Thanos syncer (i.e.,
blocks deleted after being marked), not all blocks marked for deletion.
Its help string was identical to cortex_compactor_blocks_marked_for_deletion_total,
which caused confusion for operators monitoring compaction activity.

Fixes cortexproject#3610

Signed-off-by: Goutham Annem <gouthemannem@gmail.com>
@dosubot dosubot Bot added component/compactor type/chore Something that needs to be done; not a bug or a feature type/observability To help know what is going on inside Cortex labels Jul 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/compactor size/XS type/chore Something that needs to be done; not a bug or a feature type/observability To help know what is going on inside Cortex

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Two metrics have the same help value

1 participant