From 255e014e0a188544deb0d7f9d29288b567f24810 Mon Sep 17 00:00:00 2001 From: Brad Stein Date: Mon, 17 Nov 2025 22:36:50 -0300 Subject: [PATCH] monitoring: color namespace pies --- scripts/render_dashboards.py | 35 +- .../monitoring/dashboards/atlas-overview.json | 322 +++++++++++++++++- .../grafana-dashboard-overview.yaml | 322 +++++++++++++++++- 3 files changed, 670 insertions(+), 9 deletions(-) diff --git a/scripts/render_dashboards.py b/scripts/render_dashboards.py index 74c8f7a..bec895a 100644 --- a/scripts/render_dashboards.py +++ b/scripts/render_dashboards.py @@ -361,6 +361,18 @@ def table_panel( def pie_panel(panel_id, title, expr, grid): """Return a pie chart panel with readable namespace labels.""" + palette = [ + "#EF476F", + "#FFD166", + "#06D6A0", + "#118AB2", + "#073B4C", + "#F78C6B", + "#8EECF5", + "#E0FF4F", + "#B5179E", + "#52B788", + ] return { "id": panel_id, "type": "piechart", @@ -368,7 +380,28 @@ def pie_panel(panel_id, title, expr, grid): "datasource": PROM_DS, "gridPos": grid, "targets": [{"expr": expr, "refId": "A", "legendFormat": "{{namespace}}"}], - "fieldConfig": {"defaults": {"unit": "percent"}, "overrides": []}, + "fieldConfig": { + "defaults": { + "unit": "percent", + "custom": {"gradientMode": "scheme"}, + "color": {"mode": "palette-classic"}, + }, + "overrides": [ + { + "matcher": {"id": "byIndex", "options": idx}, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": palette[idx % len(palette)], + }, + } + ], + } + for idx in range(10) + ], + }, "options": { "legend": {"displayMode": "list", "placement": "right"}, "pieType": "pie", diff --git a/services/monitoring/dashboards/atlas-overview.json b/services/monitoring/dashboards/atlas-overview.json index 753a33d..8be7f9d 100644 --- a/services/monitoring/dashboards/atlas-overview.json +++ b/services/monitoring/dashboards/atlas-overview.json @@ -729,9 +729,166 @@ ], "fieldConfig": { "defaults": { - "unit": "percent" + "unit": "percent", + "custom": { + "gradientMode": "scheme" + }, + "color": { + "mode": "palette-classic" + } }, - "overrides": [] + "overrides": [ + { + "matcher": { + "id": "byIndex", + "options": 0 + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "#EF476F" + } + } + ] + }, + { + "matcher": { + "id": "byIndex", + "options": 1 + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "#FFD166" + } + } + ] + }, + { + "matcher": { + "id": "byIndex", + "options": 2 + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "#06D6A0" + } + } + ] + }, + { + "matcher": { + "id": "byIndex", + "options": 3 + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "#118AB2" + } + } + ] + }, + { + "matcher": { + "id": "byIndex", + "options": 4 + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "#073B4C" + } + } + ] + }, + { + "matcher": { + "id": "byIndex", + "options": 5 + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "#F78C6B" + } + } + ] + }, + { + "matcher": { + "id": "byIndex", + "options": 6 + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "#8EECF5" + } + } + ] + }, + { + "matcher": { + "id": "byIndex", + "options": 7 + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "#E0FF4F" + } + } + ] + }, + { + "matcher": { + "id": "byIndex", + "options": 8 + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "#B5179E" + } + } + ] + }, + { + "matcher": { + "id": "byIndex", + "options": 9 + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "#52B788" + } + } + ] + } + ] }, "options": { "legend": { @@ -771,9 +928,166 @@ ], "fieldConfig": { "defaults": { - "unit": "percent" + "unit": "percent", + "custom": { + "gradientMode": "scheme" + }, + "color": { + "mode": "palette-classic" + } }, - "overrides": [] + "overrides": [ + { + "matcher": { + "id": "byIndex", + "options": 0 + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "#EF476F" + } + } + ] + }, + { + "matcher": { + "id": "byIndex", + "options": 1 + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "#FFD166" + } + } + ] + }, + { + "matcher": { + "id": "byIndex", + "options": 2 + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "#06D6A0" + } + } + ] + }, + { + "matcher": { + "id": "byIndex", + "options": 3 + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "#118AB2" + } + } + ] + }, + { + "matcher": { + "id": "byIndex", + "options": 4 + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "#073B4C" + } + } + ] + }, + { + "matcher": { + "id": "byIndex", + "options": 5 + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "#F78C6B" + } + } + ] + }, + { + "matcher": { + "id": "byIndex", + "options": 6 + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "#8EECF5" + } + } + ] + }, + { + "matcher": { + "id": "byIndex", + "options": 7 + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "#E0FF4F" + } + } + ] + }, + { + "matcher": { + "id": "byIndex", + "options": 8 + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "#B5179E" + } + } + ] + }, + { + "matcher": { + "id": "byIndex", + "options": 9 + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "#52B788" + } + } + ] + } + ] }, "options": { "legend": { diff --git a/services/monitoring/grafana-dashboard-overview.yaml b/services/monitoring/grafana-dashboard-overview.yaml index 97bc359..06a40c7 100644 --- a/services/monitoring/grafana-dashboard-overview.yaml +++ b/services/monitoring/grafana-dashboard-overview.yaml @@ -738,9 +738,166 @@ data: ], "fieldConfig": { "defaults": { - "unit": "percent" + "unit": "percent", + "custom": { + "gradientMode": "scheme" + }, + "color": { + "mode": "palette-classic" + } }, - "overrides": [] + "overrides": [ + { + "matcher": { + "id": "byIndex", + "options": 0 + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "#EF476F" + } + } + ] + }, + { + "matcher": { + "id": "byIndex", + "options": 1 + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "#FFD166" + } + } + ] + }, + { + "matcher": { + "id": "byIndex", + "options": 2 + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "#06D6A0" + } + } + ] + }, + { + "matcher": { + "id": "byIndex", + "options": 3 + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "#118AB2" + } + } + ] + }, + { + "matcher": { + "id": "byIndex", + "options": 4 + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "#073B4C" + } + } + ] + }, + { + "matcher": { + "id": "byIndex", + "options": 5 + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "#F78C6B" + } + } + ] + }, + { + "matcher": { + "id": "byIndex", + "options": 6 + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "#8EECF5" + } + } + ] + }, + { + "matcher": { + "id": "byIndex", + "options": 7 + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "#E0FF4F" + } + } + ] + }, + { + "matcher": { + "id": "byIndex", + "options": 8 + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "#B5179E" + } + } + ] + }, + { + "matcher": { + "id": "byIndex", + "options": 9 + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "#52B788" + } + } + ] + } + ] }, "options": { "legend": { @@ -780,9 +937,166 @@ data: ], "fieldConfig": { "defaults": { - "unit": "percent" + "unit": "percent", + "custom": { + "gradientMode": "scheme" + }, + "color": { + "mode": "palette-classic" + } }, - "overrides": [] + "overrides": [ + { + "matcher": { + "id": "byIndex", + "options": 0 + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "#EF476F" + } + } + ] + }, + { + "matcher": { + "id": "byIndex", + "options": 1 + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "#FFD166" + } + } + ] + }, + { + "matcher": { + "id": "byIndex", + "options": 2 + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "#06D6A0" + } + } + ] + }, + { + "matcher": { + "id": "byIndex", + "options": 3 + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "#118AB2" + } + } + ] + }, + { + "matcher": { + "id": "byIndex", + "options": 4 + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "#073B4C" + } + } + ] + }, + { + "matcher": { + "id": "byIndex", + "options": 5 + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "#F78C6B" + } + } + ] + }, + { + "matcher": { + "id": "byIndex", + "options": 6 + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "#8EECF5" + } + } + ] + }, + { + "matcher": { + "id": "byIndex", + "options": 7 + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "#E0FF4F" + } + } + ] + }, + { + "matcher": { + "id": "byIndex", + "options": 8 + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "#B5179E" + } + } + ] + }, + { + "matcher": { + "id": "byIndex", + "options": 9 + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "#52B788" + } + } + ] + } + ] }, "options": { "legend": {