From 41e8a6a5829fa54dd54f4f7e0b36020f0a8cc371 Mon Sep 17 00:00:00 2001 From: Brad Stein Date: Mon, 17 Nov 2025 19:49:50 -0300 Subject: [PATCH] monitoring: reorder overview stats --- scripts/render_dashboards.py | 20 +-- .../monitoring/dashboards/atlas-overview.json | 146 +++++++++--------- .../grafana-dashboard-overview.yaml | 146 +++++++++--------- 3 files changed, 156 insertions(+), 156 deletions(-) diff --git a/scripts/render_dashboards.py b/scripts/render_dashboards.py index d726015..97d64cd 100644 --- a/scripts/render_dashboards.py +++ b/scripts/render_dashboards.py @@ -376,9 +376,8 @@ def build_overview(): panels = [] row1_stats = [ - (1, "Running pods", 'sum(kube_pod_status_phase{phase="Running"})', None, None, None), ( - 2, + 1, "Workers ready", f'sum(kube_node_status_condition{{condition="Ready",status="true",node=~"{WORKER_REGEX}"}})', WORKER_SUFFIX, @@ -386,7 +385,7 @@ def build_overview(): None, ), ( - 3, + 2, "Control plane ready", f'sum(kube_node_status_condition{{condition="Ready",status="true",node=~"{CONTROL_REGEX}"}})', CONTROL_SUFFIX, @@ -394,7 +393,7 @@ def build_overview(): None, ), ( - 4, + 3, "Control plane workloads", f'sum(kube_pod_info{{node=~"{CONTROL_REGEX}",namespace!~"{CP_ALLOWED_NS}"}})', None, @@ -402,7 +401,7 @@ def build_overview(): link_to("atlas-pods"), ), ( - 5, + 4, "Problem pods", PROBLEM_PODS_EXPR, None, @@ -410,17 +409,18 @@ def build_overview(): link_to("atlas-pods"), ), ( - 6, + 5, "Stuck terminating", STUCK_TERMINATING_EXPR, None, 1, link_to("atlas-pods"), ), + (6, "Running pods", 'sum(kube_pod_status_phase{phase="Running"})', None, None, None), ] for idx, (panel_id, title, expr, suffix, ok_value, links) in enumerate(row1_stats): thresholds = None - if panel_id == 2: + if panel_id == 1: thresholds = { "mode": "absolute", "steps": [ @@ -430,7 +430,7 @@ def build_overview(): {"color": "green", "value": WORKER_TOTAL}, ], } - elif panel_id == 3: + elif panel_id == 2: thresholds = { "mode": "absolute", "steps": [ @@ -438,7 +438,7 @@ def build_overview(): {"color": "green", "value": CONTROL_TOTAL}, ], } - elif panel_id in (4, 5, 6): + elif panel_id in (3, 4, 5): thresholds = { "mode": "absolute", "steps": [ @@ -475,7 +475,7 @@ def build_overview(): {"h": 5, "w": 6, "x": 6 * idx, "y": 5}, unit=unit, thresholds=PERCENT_THRESHOLDS if unit == "percent" else None, - text_mode="value_and_name", + text_mode="name_and_value", legend="{{node}}", instant=True, links=link_to("atlas-nodes"), diff --git a/services/monitoring/dashboards/atlas-overview.json b/services/monitoring/dashboards/atlas-overview.json index 1442cf5..d51d203 100644 --- a/services/monitoring/dashboards/atlas-overview.json +++ b/services/monitoring/dashboards/atlas-overview.json @@ -10,66 +10,6 @@ { "id": 1, "type": "stat", - "title": "Running pods", - "datasource": { - "type": "prometheus", - "uid": "atlas-vm" - }, - "gridPos": { - "h": 5, - "w": 4, - "x": 0, - "y": 0 - }, - "targets": [ - { - "expr": "sum(kube_pod_status_phase{phase=\"Running\"})", - "refId": "A" - } - ], - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "rgba(115, 115, 115, 1)", - "value": null - }, - { - "color": "green", - "value": 1 - } - ] - }, - "unit": "none", - "custom": { - "displayMode": "auto" - } - }, - "overrides": [] - }, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "center", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "textMode": "value" - } - }, - { - "id": 2, - "type": "stat", "title": "Workers ready", "datasource": { "type": "prometheus", @@ -78,7 +18,7 @@ "gridPos": { "h": 5, "w": 4, - "x": 4, + "x": 0, "y": 0 }, "targets": [ @@ -137,7 +77,7 @@ } }, { - "id": 3, + "id": 2, "type": "stat", "title": "Control plane ready", "datasource": { @@ -147,7 +87,7 @@ "gridPos": { "h": 5, "w": 4, - "x": 8, + "x": 4, "y": 0 }, "targets": [ @@ -198,7 +138,7 @@ } }, { - "id": 4, + "id": 3, "type": "stat", "title": "Control plane workloads", "datasource": { @@ -208,7 +148,7 @@ "gridPos": { "h": 5, "w": 4, - "x": 12, + "x": 8, "y": 0 }, "targets": [ @@ -273,7 +213,7 @@ ] }, { - "id": 5, + "id": 4, "type": "stat", "title": "Problem pods", "datasource": { @@ -283,7 +223,7 @@ "gridPos": { "h": 5, "w": 4, - "x": 16, + "x": 12, "y": 0 }, "targets": [ @@ -348,7 +288,7 @@ ] }, { - "id": 6, + "id": 5, "type": "stat", "title": "Stuck terminating", "datasource": { @@ -358,7 +298,7 @@ "gridPos": { "h": 5, "w": 4, - "x": 20, + "x": 16, "y": 0 }, "targets": [ @@ -422,6 +362,66 @@ } ] }, + { + "id": 6, + "type": "stat", + "title": "Running pods", + "datasource": { + "type": "prometheus", + "uid": "atlas-vm" + }, + "gridPos": { + "h": 5, + "w": 4, + "x": 20, + "y": 0 + }, + "targets": [ + { + "expr": "sum(kube_pod_status_phase{phase=\"Running\"})", + "refId": "A" + } + ], + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "rgba(115, 115, 115, 1)", + "value": null + }, + { + "color": "green", + "value": 1 + } + ] + }, + "unit": "none", + "custom": { + "displayMode": "auto" + } + }, + "overrides": [] + }, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "center", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "textMode": "value" + } + }, { "id": 7, "type": "stat", @@ -485,7 +485,7 @@ "fields": "", "values": false }, - "textMode": "value_and_name" + "textMode": "name_and_value" }, "links": [ { @@ -558,7 +558,7 @@ "fields": "", "values": false }, - "textMode": "value_and_name" + "textMode": "name_and_value" }, "links": [ { @@ -627,7 +627,7 @@ "fields": "", "values": false }, - "textMode": "value_and_name" + "textMode": "name_and_value" }, "links": [ { @@ -696,7 +696,7 @@ "fields": "", "values": false }, - "textMode": "value_and_name" + "textMode": "name_and_value" }, "links": [ { diff --git a/services/monitoring/grafana-dashboard-overview.yaml b/services/monitoring/grafana-dashboard-overview.yaml index ac95eae..8d03cf6 100644 --- a/services/monitoring/grafana-dashboard-overview.yaml +++ b/services/monitoring/grafana-dashboard-overview.yaml @@ -19,66 +19,6 @@ data: { "id": 1, "type": "stat", - "title": "Running pods", - "datasource": { - "type": "prometheus", - "uid": "atlas-vm" - }, - "gridPos": { - "h": 5, - "w": 4, - "x": 0, - "y": 0 - }, - "targets": [ - { - "expr": "sum(kube_pod_status_phase{phase=\"Running\"})", - "refId": "A" - } - ], - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "rgba(115, 115, 115, 1)", - "value": null - }, - { - "color": "green", - "value": 1 - } - ] - }, - "unit": "none", - "custom": { - "displayMode": "auto" - } - }, - "overrides": [] - }, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "center", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "textMode": "value" - } - }, - { - "id": 2, - "type": "stat", "title": "Workers ready", "datasource": { "type": "prometheus", @@ -87,7 +27,7 @@ data: "gridPos": { "h": 5, "w": 4, - "x": 4, + "x": 0, "y": 0 }, "targets": [ @@ -146,7 +86,7 @@ data: } }, { - "id": 3, + "id": 2, "type": "stat", "title": "Control plane ready", "datasource": { @@ -156,7 +96,7 @@ data: "gridPos": { "h": 5, "w": 4, - "x": 8, + "x": 4, "y": 0 }, "targets": [ @@ -207,7 +147,7 @@ data: } }, { - "id": 4, + "id": 3, "type": "stat", "title": "Control plane workloads", "datasource": { @@ -217,7 +157,7 @@ data: "gridPos": { "h": 5, "w": 4, - "x": 12, + "x": 8, "y": 0 }, "targets": [ @@ -282,7 +222,7 @@ data: ] }, { - "id": 5, + "id": 4, "type": "stat", "title": "Problem pods", "datasource": { @@ -292,7 +232,7 @@ data: "gridPos": { "h": 5, "w": 4, - "x": 16, + "x": 12, "y": 0 }, "targets": [ @@ -357,7 +297,7 @@ data: ] }, { - "id": 6, + "id": 5, "type": "stat", "title": "Stuck terminating", "datasource": { @@ -367,7 +307,7 @@ data: "gridPos": { "h": 5, "w": 4, - "x": 20, + "x": 16, "y": 0 }, "targets": [ @@ -431,6 +371,66 @@ data: } ] }, + { + "id": 6, + "type": "stat", + "title": "Running pods", + "datasource": { + "type": "prometheus", + "uid": "atlas-vm" + }, + "gridPos": { + "h": 5, + "w": 4, + "x": 20, + "y": 0 + }, + "targets": [ + { + "expr": "sum(kube_pod_status_phase{phase=\"Running\"})", + "refId": "A" + } + ], + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "rgba(115, 115, 115, 1)", + "value": null + }, + { + "color": "green", + "value": 1 + } + ] + }, + "unit": "none", + "custom": { + "displayMode": "auto" + } + }, + "overrides": [] + }, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "center", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "textMode": "value" + } + }, { "id": 7, "type": "stat", @@ -494,7 +494,7 @@ data: "fields": "", "values": false }, - "textMode": "value_and_name" + "textMode": "name_and_value" }, "links": [ { @@ -567,7 +567,7 @@ data: "fields": "", "values": false }, - "textMode": "value_and_name" + "textMode": "name_and_value" }, "links": [ { @@ -636,7 +636,7 @@ data: "fields": "", "values": false }, - "textMode": "value_and_name" + "textMode": "name_and_value" }, "links": [ { @@ -705,7 +705,7 @@ data: "fields": "", "values": false }, - "textMode": "value_and_name" + "textMode": "name_and_value" }, "links": [ {