Skip to content

Fix "total compression savings" query on Magma - Node & Bucket dashboard#139

Open
t3rm1n4l wants to merge 1 commit intocouchbaselabs:masterfrom
t3rm1n4l:magma-compression-label-fix
Open

Fix "total compression savings" query on Magma - Node & Bucket dashboard#139
t3rm1n4l wants to merge 1 commit intocouchbaselabs:masterfrom
t3rm1n4l:magma-compression-label-fix

Conversation

@t3rm1n4l
Copy link
Copy Markdown
Member

The total compression savings % series silently dropped on any bucket with non-zero per-doc Snappy counters — Prometheus errored with multiple matches for labels: many-to-one matching must be explicit.

Root cause: the old expression used ignoring(name) + an or fallback 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 in magma-node.json).

Verified on compressionMode=active and compressionMode=off.

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.
Copilot AI review requested due to automatic review settings April 21, 2026 20:36
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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) + or fallback logic that produced mismatched label sets with sum 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.

@t3rm1n4l t3rm1n4l requested a review from dave-finlay April 21, 2026 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants