From c50876bef0f21e3f721db805ac1e20a73aed12a3 Mon Sep 17 00:00:00 2001 From: Sarath Lakshman Date: Tue, 21 Apr 2026 13:24:24 -0700 Subject: [PATCH] Fix total compression savings query failing on active buckets 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. --- dashboards/magma-nodebucket.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dashboards/magma-nodebucket.json b/dashboards/magma-nodebucket.json index f800a6f..8481f3b 100644 --- a/dashboards/magma-nodebucket.json +++ b/dashboards/magma-nodebucket.json @@ -1259,7 +1259,7 @@ }, { "editorMode": "code", - "expr": "(1 - ((kv_ep_total_compressed_value_size_bytes{bucket=\"$bucket\"} / ignoring(name) (kv_ep_total_decompressed_value_size_bytes{bucket=\"$bucket\"} > 0)) or (kv_ep_total_compressed_value_size_bytes{bucket=\"$bucket\"} * 0 + 1)) * ignoring(name) (kv_ep_magma_data_blocks_compressed_size{bucket=\"$bucket\"} / ignoring(name) kv_ep_magma_data_blocks_uncompressed_size{bucket=\"$bucket\"})) * 100", + "expr": "(1 - ((sum by (bucket) (kv_ep_total_compressed_value_size_bytes{bucket=\"$bucket\"}) / (sum by (bucket) (kv_ep_total_decompressed_value_size_bytes{bucket=\"$bucket\"}) > 0)) or (sum by (bucket) (kv_ep_total_compressed_value_size_bytes{bucket=\"$bucket\"}) * 0 + 1)) * (sum by (bucket) (kv_ep_magma_data_blocks_compressed_size{bucket=\"$bucket\"}) / sum by (bucket) (kv_ep_magma_data_blocks_uncompressed_size{bucket=\"$bucket\"}))) * 100", "hide": false, "legendFormat": "total compression savings %", "range": true,