Fix "total compression savings" query on Magma - Node & Bucket dashboard#139
Open
t3rm1n4l wants to merge 1 commit intocouchbaselabs:masterfrom
Open
Fix "total compression savings" query on Magma - Node & Bucket dashboard#139t3rm1n4l wants to merge 1 commit intocouchbaselabs:masterfrom
t3rm1n4l wants to merge 1 commit intocouchbaselabs:masterfrom
Conversation
The Compression panel's "total compression savings %" errored with "multiple matches for labels: many-to-one matching must be explicit" on any bucket with non-zero per-doc Snappy counters: the four kv_ep_* metrics each carry a distinct 'name' label, and the old expression stitched them together with 'ignoring(name)' + 'or' fallback whose operands ended up with mismatched label sets. Rewrite with 'sum by (bucket)' on every metric (matches magma-node.json style). Same numeric result, no more ignoring-hacks.
There was a problem hiding this comment.
Pull request overview
Fixes the PromQL for the “total compression savings %” series in the Magma Node & Bucket dashboard so it no longer disappears due to a Prometheus many-to-one label matching error, by aligning aggregation/labeling with the working approach used in magma-node.json.
Changes:
- Replace
ignoring(name)+orfallback logic that produced mismatched label sets withsum by (bucket)aggregation on each metric. - Ensure the expression yields a single per-bucket series (avoiding duplicate series from per-doc Snappy counters).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
The
total compression savings %series silently dropped on any bucket with non-zero per-doc Snappy counters — Prometheus errored withmultiple matches for labels: many-to-one matching must be explicit.Root cause: the old expression used
ignoring(name)+ anorfallback whose operands ended up with mismatched label sets, so Prometheus kept two series where one was expected.Fix: use
sum by (bucket)on every metric (matches the style inmagma-node.json).Verified on
compressionMode=activeandcompressionMode=off.