Skip to content

store-gateway: change old blocks to be reported as 'unknown/old_block' in metrics #11891

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

dimitarvdimitrov
Copy link
Contributor

Level 0 blocks in metrics indicate metadata from before we started tracking compaction levels in bucket index (pre-January 2024). This change improves metric clarity by labeling them as 'unknown/old_block' instead of '0'.

Background:

  • Blocks are correctly created with level 1 in Prometheus compactor:

  • CompactionLevel field was added to bucket index in dcc2d9bb (January 2024)

  • The updateBlockIndexEntry function only runs for new blocks, which explains why existing blocks had zero-valued compaction level.

Discovered while working on #11803.

Newly shipped blocks get level 1. Level 0 indicates that the block's
metadata was included in the bucket index before we started adding
compaction level information (pre-January 2024).

This change improves metric clarity by distinguishing between blocks
with genuinely unknown levels versus blocks that were legitimately
created before the compaction level field was added.
@dimitarvdimitrov dimitarvdimitrov changed the title Change level 0 blocks to be reported as 'unknown/old_block' in metrics Jun 27, 2025
Signed-off-by: Dimitar Dimitrov <dimitar.dimitrov@grafana.com>
Co-authored-by: Taylor C <41653732+tacole02@users.noreply.github.com>
Copy link
Collaborator

@pracucci pracucci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants