From 56bb4e91b90bbf17081b411bc7e61608f30a3a2a Mon Sep 17 00:00:00 2001 From: Brad Stein Date: Sat, 13 Dec 2025 22:17:47 -0300 Subject: [PATCH] Group namespace plurality rows to one per namespace --- scripts/dashboards_render_atlas.py | 18 +++++++++++-- .../monitoring/dashboards/atlas-pods.json | 27 ++++++++++++++++--- .../monitoring/grafana-dashboard-pods.yaml | 27 ++++++++++++++++--- 3 files changed, 64 insertions(+), 8 deletions(-) diff --git a/scripts/dashboards_render_atlas.py b/scripts/dashboards_render_atlas.py index 7970b2c..894edb9 100644 --- a/scripts/dashboards_render_atlas.py +++ b/scripts/dashboards_render_atlas.py @@ -1210,7 +1210,7 @@ def build_pods_dashboard(): panels.append( table_panel( 10, - "Namespace Plurality by Node v26", + "Namespace Plurality by Node v27", ( f"{share_expr} * on(namespace,node) group_left() " f"({mask_expr})" @@ -1223,7 +1223,21 @@ def build_pods_dashboard(): {"id": "filterByValue", "options": {"match": "Value", "operator": "gt", "value": 0}}, { "id": "sortBy", - "options": {"fields": ["node", "Value"], "order": "asc"}, + "options": {"fields": ["Value"], "order": "desc"}, + }, + { + "id": "groupBy", + "options": { + "fields": { + "namespace": { + "aggregations": [ + {"field": "Value", "operation": "max"}, + {"field": "node", "operation": "first"}, + ] + } + }, + "rowBy": ["namespace"], + }, }, ], instant=True, diff --git a/services/monitoring/dashboards/atlas-pods.json b/services/monitoring/dashboards/atlas-pods.json index a7a27e5..4b2a54a 100644 --- a/services/monitoring/dashboards/atlas-pods.json +++ b/services/monitoring/dashboards/atlas-pods.json @@ -507,7 +507,7 @@ { "id": 10, "type": "table", - "title": "Namespace Plurality by Node v26", + "title": "Namespace Plurality by Node v27", "datasource": { "type": "prometheus", "uid": "atlas-vm" @@ -570,10 +570,31 @@ "id": "sortBy", "options": { "fields": [ - "node", "Value" ], - "order": "asc" + "order": "desc" + } + }, + { + "id": "groupBy", + "options": { + "fields": { + "namespace": { + "aggregations": [ + { + "field": "Value", + "operation": "max" + }, + { + "field": "node", + "operation": "first" + } + ] + } + }, + "rowBy": [ + "namespace" + ] } } ] diff --git a/services/monitoring/grafana-dashboard-pods.yaml b/services/monitoring/grafana-dashboard-pods.yaml index 13ea708..b7c49d5 100644 --- a/services/monitoring/grafana-dashboard-pods.yaml +++ b/services/monitoring/grafana-dashboard-pods.yaml @@ -516,7 +516,7 @@ data: { "id": 10, "type": "table", - "title": "Namespace Plurality by Node v26", + "title": "Namespace Plurality by Node v27", "datasource": { "type": "prometheus", "uid": "atlas-vm" @@ -579,10 +579,31 @@ data: "id": "sortBy", "options": { "fields": [ - "node", "Value" ], - "order": "asc" + "order": "desc" + } + }, + { + "id": "groupBy", + "options": { + "fields": { + "namespace": { + "aggregations": [ + { + "field": "Value", + "operation": "max" + }, + { + "field": "node", + "operation": "first" + } + ] + } + }, + "rowBy": [ + "namespace" + ] } } ]