From 2db8e1423dd2ff0a52798d6b33ce86c50e3b5492 Mon Sep 17 00:00:00 2001 From: Brad Stein Date: Mon, 13 Apr 2026 20:57:51 -0300 Subject: [PATCH] monitoring(overview): fix jenkins row links, status color, and ordering --- scripts/dashboards_render_atlas.py | 29 +++++- .../monitoring/dashboards/atlas-overview.json | 92 ++++++++++++++++++- .../grafana-dashboard-overview.yaml | 92 ++++++++++++++++++- 3 files changed, 204 insertions(+), 9 deletions(-) diff --git a/scripts/dashboards_render_atlas.py b/scripts/dashboards_render_atlas.py index 7397b111..fd5352ab 100644 --- a/scripts/dashboards_render_atlas.py +++ b/scripts/dashboards_render_atlas.py @@ -1626,6 +1626,20 @@ def jenkins_weather_scroll_table_panel( expr, grid, unit=unit, + targets=[ + { + "refId": "A", + "expr": _jenkins_weather_status_expr(expr, "== 1"), + "instant": True, + "format": "table", + }, + { + "refId": "B", + "expr": _jenkins_weather_status_expr(expr, "!= 1"), + "instant": True, + "format": "table", + }, + ], instant=True, format="table", filterable=False, @@ -1659,7 +1673,7 @@ def jenkins_weather_scroll_table_panel( "value": [ { "title": "Open Jenkins job", - "url": "${__data.fields.job_url}", + "url": "https://ci.bstein.dev/job/${__value.raw}/", "targetBlank": True, } ], @@ -1672,6 +1686,19 @@ def jenkins_weather_scroll_table_panel( {"id": "decimals", "value": decimals}, {"id": "custom.width", "value": 74}, {"id": "custom.align", "value": "right"}, + {"id": "custom.cellOptions", "value": {"type": "color-text"}}, + ], + }, + { + "matcher": {"id": "byFrameRefID", "options": "A"}, + "properties": [ + {"id": "color", "value": {"mode": "fixed", "fixedColor": "green"}}, + ], + }, + { + "matcher": {"id": "byFrameRefID", "options": "B"}, + "properties": [ + {"id": "color", "value": {"mode": "fixed", "fixedColor": "red"}}, ], }, ], diff --git a/services/monitoring/dashboards/atlas-overview.json b/services/monitoring/dashboards/atlas-overview.json index 3216bce6..35ada63e 100644 --- a/services/monitoring/dashboards/atlas-overview.json +++ b/services/monitoring/dashboards/atlas-overview.json @@ -2297,8 +2297,14 @@ }, "targets": [ { - "expr": "min by (exported_job,job_url,weather_icon) ((time() - ariadne_jenkins_build_weather_job_last_success_timestamp_seconds) / 3600)", "refId": "A", + "expr": "(min by (exported_job,job_url,weather_icon) ((time() - ariadne_jenkins_build_weather_job_last_success_timestamp_seconds) / 3600)) and on(exported_job,job_url,weather_icon) (max by (exported_job,job_url,weather_icon) (ariadne_jenkins_build_weather_job_last_status) == 1)", + "instant": true, + "format": "table" + }, + { + "refId": "B", + "expr": "(min by (exported_job,job_url,weather_icon) ((time() - ariadne_jenkins_build_weather_job_last_success_timestamp_seconds) / 3600)) and on(exported_job,job_url,weather_icon) (max by (exported_job,job_url,weather_icon) (ariadne_jenkins_build_weather_job_last_status) != 1)", "instant": true, "format": "table" } @@ -2342,7 +2348,7 @@ "value": [ { "title": "Open Jenkins job", - "url": "${__data.fields.job_url}", + "url": "https://ci.bstein.dev/job/${__value.raw}/", "targetBlank": true } ] @@ -2366,6 +2372,42 @@ { "id": "custom.align", "value": "right" + }, + { + "id": "custom.cellOptions", + "value": { + "type": "color-text" + } + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "A" + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "green" + } + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "B" + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "red" + } } ] } @@ -2435,8 +2477,14 @@ }, "targets": [ { - "expr": "min by (exported_job,job_url,weather_icon) ((time() - ariadne_jenkins_build_weather_job_last_failure_timestamp_seconds) / 3600)", "refId": "A", + "expr": "(min by (exported_job,job_url,weather_icon) ((time() - ariadne_jenkins_build_weather_job_last_failure_timestamp_seconds) / 3600)) and on(exported_job,job_url,weather_icon) (max by (exported_job,job_url,weather_icon) (ariadne_jenkins_build_weather_job_last_status) == 1)", + "instant": true, + "format": "table" + }, + { + "refId": "B", + "expr": "(min by (exported_job,job_url,weather_icon) ((time() - ariadne_jenkins_build_weather_job_last_failure_timestamp_seconds) / 3600)) and on(exported_job,job_url,weather_icon) (max by (exported_job,job_url,weather_icon) (ariadne_jenkins_build_weather_job_last_status) != 1)", "instant": true, "format": "table" } @@ -2480,7 +2528,7 @@ "value": [ { "title": "Open Jenkins job", - "url": "${__data.fields.job_url}", + "url": "https://ci.bstein.dev/job/${__value.raw}/", "targetBlank": true } ] @@ -2504,6 +2552,42 @@ { "id": "custom.align", "value": "right" + }, + { + "id": "custom.cellOptions", + "value": { + "type": "color-text" + } + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "A" + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "green" + } + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "B" + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "red" + } } ] } diff --git a/services/monitoring/grafana-dashboard-overview.yaml b/services/monitoring/grafana-dashboard-overview.yaml index fa0bd037..eca66a6a 100644 --- a/services/monitoring/grafana-dashboard-overview.yaml +++ b/services/monitoring/grafana-dashboard-overview.yaml @@ -2306,8 +2306,14 @@ data: }, "targets": [ { - "expr": "min by (exported_job,job_url,weather_icon) ((time() - ariadne_jenkins_build_weather_job_last_success_timestamp_seconds) / 3600)", "refId": "A", + "expr": "(min by (exported_job,job_url,weather_icon) ((time() - ariadne_jenkins_build_weather_job_last_success_timestamp_seconds) / 3600)) and on(exported_job,job_url,weather_icon) (max by (exported_job,job_url,weather_icon) (ariadne_jenkins_build_weather_job_last_status) == 1)", + "instant": true, + "format": "table" + }, + { + "refId": "B", + "expr": "(min by (exported_job,job_url,weather_icon) ((time() - ariadne_jenkins_build_weather_job_last_success_timestamp_seconds) / 3600)) and on(exported_job,job_url,weather_icon) (max by (exported_job,job_url,weather_icon) (ariadne_jenkins_build_weather_job_last_status) != 1)", "instant": true, "format": "table" } @@ -2351,7 +2357,7 @@ data: "value": [ { "title": "Open Jenkins job", - "url": "${__data.fields.job_url}", + "url": "https://ci.bstein.dev/job/${__value.raw}/", "targetBlank": true } ] @@ -2375,6 +2381,42 @@ data: { "id": "custom.align", "value": "right" + }, + { + "id": "custom.cellOptions", + "value": { + "type": "color-text" + } + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "A" + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "green" + } + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "B" + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "red" + } } ] } @@ -2444,8 +2486,14 @@ data: }, "targets": [ { - "expr": "min by (exported_job,job_url,weather_icon) ((time() - ariadne_jenkins_build_weather_job_last_failure_timestamp_seconds) / 3600)", "refId": "A", + "expr": "(min by (exported_job,job_url,weather_icon) ((time() - ariadne_jenkins_build_weather_job_last_failure_timestamp_seconds) / 3600)) and on(exported_job,job_url,weather_icon) (max by (exported_job,job_url,weather_icon) (ariadne_jenkins_build_weather_job_last_status) == 1)", + "instant": true, + "format": "table" + }, + { + "refId": "B", + "expr": "(min by (exported_job,job_url,weather_icon) ((time() - ariadne_jenkins_build_weather_job_last_failure_timestamp_seconds) / 3600)) and on(exported_job,job_url,weather_icon) (max by (exported_job,job_url,weather_icon) (ariadne_jenkins_build_weather_job_last_status) != 1)", "instant": true, "format": "table" } @@ -2489,7 +2537,7 @@ data: "value": [ { "title": "Open Jenkins job", - "url": "${__data.fields.job_url}", + "url": "https://ci.bstein.dev/job/${__value.raw}/", "targetBlank": true } ] @@ -2513,6 +2561,42 @@ data: { "id": "custom.align", "value": "right" + }, + { + "id": "custom.cellOptions", + "value": { + "type": "color-text" + } + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "A" + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "green" + } + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "B" + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "red" + } } ] }