Add block-size observability at flush and compaction - #7773
Draft
zalegrala wants to merge 2 commits into
Draft
Conversation
…paction Adds tempo_block_builder_flush_size_bytes (block-builder flush path) and tempodb_compaction_output_block_size_bytes (compaction output), mirroring the existing live-store tempo_live_store_local_flush_size_bytes metric. Closes the observability gap needed to inform max_input_blocks tuning and TCO analysis.
metricBlockBuilderFlushSize was declared but never observed, tripping the unused-var lint check.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does:
Adds two native-histogram metrics closing an observability gap around the size of backend blocks:
tempo_block_builder_flush_size_bytes— size of blocks written by the block-builder flush path. The live-store flush path already has this (tempo_live_store_local_flush_size_bytes); the block-builder path had no equivalent, only a flushed-blocks counter.tempodb_compaction_output_block_size_bytes— size of blocks produced by compaction. No existing metric captures this;tempodb_compaction_bytes_written_totalis a cumulative counter fed per row-group flush during compaction, not a per-finished-block size.Both reuse
BlockMeta.Size_, which is already populated at both call sites, so no new size computation is introduced. Both follow the existing native-histogram convention in this codebase (NativeHistogramBucketFactor: 1.1,NativeHistogramMaxBucketNumber: 100,NativeHistogramMinResetDuration: 1h, classic exponential buckets starting at 1MiB), matchingmetricFlushSizeinmodules/livestore/complete_block_lifecycle.go. Neither carries a tenant label — block size is a storage/config characteristic here, and this keeps cardinality low.Motivation: this data is a prerequisite for reasoning about tuning
max_input_blockson scheduled compactions (intempodb/compactor.go,tempodb/blockselector/compaction_block_selector.go,modules/backendscheduler/provider/compaction.go) for TCO, and separately for understanding how block size affects query performance. This PR is scoped to just the observability gap — no dashboard/mixin changes, no compaction behavior changes.Out of scope: tenant-ring sharding tuning,
max_input_blockschanges, and dashboard additions are left as follow-ups once data is available. This is unrelated to the in-flight redaction work.Which issue(s) this PR fixes:
N/A — no tracking issue yet.
Checklist
.chloggen/(runmake chlog-new, ormake chlog-new FILENAME=<name>to override the default branch-name file; see.chloggen/README.md)