From cf988e361b2e01a616cff38e2251d9c6ad6d477c Mon Sep 17 00:00:00 2001 From: Brad Stein Date: Mon, 13 Apr 2026 14:24:52 -0300 Subject: [PATCH] monitoring(overview): make jenkins success/failure lists readable --- scripts/dashboards_render_atlas.py | 22 +++++++----- .../monitoring/dashboards/atlas-overview.json | 36 +++++++------------ .../grafana-dashboard-overview.yaml | 36 +++++++------------ 3 files changed, 38 insertions(+), 56 deletions(-) diff --git a/scripts/dashboards_render_atlas.py b/scripts/dashboards_render_atlas.py index 78b523e6..880e58ac 100644 --- a/scripts/dashboards_render_atlas.py +++ b/scripts/dashboards_render_atlas.py @@ -496,6 +496,12 @@ JENKINS_BUILD_WEATHER_LAST_SUCCESS_AGE_HOURS = ( JENKINS_BUILD_WEATHER_LAST_FAILURE_AGE_HOURS = ( "(time() - ariadne_jenkins_build_weather_job_last_failure_timestamp_seconds) / 3600" ) +JENKINS_BUILD_WEATHER_LAST_SUCCESS_NEWEST_6_HOURS = ( + f"sort(bottomk(6, {JENKINS_BUILD_WEATHER_LAST_SUCCESS_AGE_HOURS}))" +) +JENKINS_BUILD_WEATHER_LAST_FAILURE_NEWEST_6_HOURS = ( + f"sort(bottomk(6, {JENKINS_BUILD_WEATHER_LAST_FAILURE_AGE_HOURS}))" +) JENKINS_BUILD_WEATHER_LAST_DURATION_MINUTES = ( "ariadne_jenkins_build_weather_job_last_duration_seconds / 60" ) @@ -2183,14 +2189,14 @@ def build_overview(): jenkins_weather_statlist_panel( 142, "Jenkins Last Success (h, newest first)", - JENKINS_BUILD_WEATHER_LAST_SUCCESS_AGE_HOURS, + JENKINS_BUILD_WEATHER_LAST_SUCCESS_NEWEST_6_HOURS, {"h": 5, "w": 4, "x": 8, "y": 32}, unit="h", decimals=1, sort_order="asc", - limit=6, - title_size=11, - value_size=11, + limit=None, + title_size=12, + value_size=12, links=link_to("atlas-jobs"), description="Age since each job's most recent successful run; newest runs appear first.", ) @@ -2199,14 +2205,14 @@ def build_overview(): jenkins_weather_statlist_panel( 243, "Jenkins Last Failure (h, newest first)", - JENKINS_BUILD_WEATHER_LAST_FAILURE_AGE_HOURS, + JENKINS_BUILD_WEATHER_LAST_FAILURE_NEWEST_6_HOURS, {"h": 5, "w": 4, "x": 12, "y": 32}, unit="h", decimals=1, sort_order="asc", - limit=6, - title_size=11, - value_size=11, + limit=None, + title_size=12, + value_size=12, links=link_to("atlas-jobs"), description="Age since each job's most recent failed run; newest failures appear first.", ) diff --git a/services/monitoring/dashboards/atlas-overview.json b/services/monitoring/dashboards/atlas-overview.json index 092fbf43..f0a75a9c 100644 --- a/services/monitoring/dashboards/atlas-overview.json +++ b/services/monitoring/dashboards/atlas-overview.json @@ -2298,25 +2298,25 @@ "targets": [ { "refId": "A", - "expr": "((time() - ariadne_jenkins_build_weather_job_last_success_timestamp_seconds) / 3600) and on(exported_job,job_url,weather_icon) (ariadne_jenkins_build_weather_job_last_status == 1)", + "expr": "(sort(bottomk(6, (time() - ariadne_jenkins_build_weather_job_last_success_timestamp_seconds) / 3600))) and on(exported_job,job_url,weather_icon) (ariadne_jenkins_build_weather_job_last_status == 1)", "legendFormat": "{{weather_icon}} {{exported_job}}", "instant": true }, { "refId": "B", - "expr": "((time() - ariadne_jenkins_build_weather_job_last_success_timestamp_seconds) / 3600) and on(exported_job,job_url,weather_icon) (ariadne_jenkins_build_weather_job_last_status == 0)", + "expr": "(sort(bottomk(6, (time() - ariadne_jenkins_build_weather_job_last_success_timestamp_seconds) / 3600))) and on(exported_job,job_url,weather_icon) (ariadne_jenkins_build_weather_job_last_status == 0)", "legendFormat": "{{weather_icon}} {{exported_job}}", "instant": true }, { "refId": "C", - "expr": "((time() - ariadne_jenkins_build_weather_job_last_success_timestamp_seconds) / 3600) and on(exported_job,job_url,weather_icon) (ariadne_jenkins_build_weather_job_last_status == 2)", + "expr": "(sort(bottomk(6, (time() - ariadne_jenkins_build_weather_job_last_success_timestamp_seconds) / 3600))) and on(exported_job,job_url,weather_icon) (ariadne_jenkins_build_weather_job_last_status == 2)", "legendFormat": "{{weather_icon}} {{exported_job}}", "instant": true }, { "refId": "D", - "expr": "((time() - ariadne_jenkins_build_weather_job_last_success_timestamp_seconds) / 3600) and on(exported_job,job_url,weather_icon) (ariadne_jenkins_build_weather_job_last_status < 0)", + "expr": "(sort(bottomk(6, (time() - ariadne_jenkins_build_weather_job_last_success_timestamp_seconds) / 3600))) and on(exported_job,job_url,weather_icon) (ariadne_jenkins_build_weather_job_last_status < 0)", "legendFormat": "{{weather_icon}} {{exported_job}}", "instant": true } @@ -2412,8 +2412,8 @@ }, "textMode": "name_and_value", "text": { - "titleSize": 11, - "valueSize": 11 + "titleSize": 12, + "valueSize": 12 } }, "transformations": [ @@ -2425,12 +2425,6 @@ ], "order": "asc" } - }, - { - "id": "limit", - "options": { - "limit": 6 - } } ], "links": [ @@ -2459,25 +2453,25 @@ "targets": [ { "refId": "A", - "expr": "((time() - ariadne_jenkins_build_weather_job_last_failure_timestamp_seconds) / 3600) and on(exported_job,job_url,weather_icon) (ariadne_jenkins_build_weather_job_last_status == 1)", + "expr": "(sort(bottomk(6, (time() - ariadne_jenkins_build_weather_job_last_failure_timestamp_seconds) / 3600))) and on(exported_job,job_url,weather_icon) (ariadne_jenkins_build_weather_job_last_status == 1)", "legendFormat": "{{weather_icon}} {{exported_job}}", "instant": true }, { "refId": "B", - "expr": "((time() - ariadne_jenkins_build_weather_job_last_failure_timestamp_seconds) / 3600) and on(exported_job,job_url,weather_icon) (ariadne_jenkins_build_weather_job_last_status == 0)", + "expr": "(sort(bottomk(6, (time() - ariadne_jenkins_build_weather_job_last_failure_timestamp_seconds) / 3600))) and on(exported_job,job_url,weather_icon) (ariadne_jenkins_build_weather_job_last_status == 0)", "legendFormat": "{{weather_icon}} {{exported_job}}", "instant": true }, { "refId": "C", - "expr": "((time() - ariadne_jenkins_build_weather_job_last_failure_timestamp_seconds) / 3600) and on(exported_job,job_url,weather_icon) (ariadne_jenkins_build_weather_job_last_status == 2)", + "expr": "(sort(bottomk(6, (time() - ariadne_jenkins_build_weather_job_last_failure_timestamp_seconds) / 3600))) and on(exported_job,job_url,weather_icon) (ariadne_jenkins_build_weather_job_last_status == 2)", "legendFormat": "{{weather_icon}} {{exported_job}}", "instant": true }, { "refId": "D", - "expr": "((time() - ariadne_jenkins_build_weather_job_last_failure_timestamp_seconds) / 3600) and on(exported_job,job_url,weather_icon) (ariadne_jenkins_build_weather_job_last_status < 0)", + "expr": "(sort(bottomk(6, (time() - ariadne_jenkins_build_weather_job_last_failure_timestamp_seconds) / 3600))) and on(exported_job,job_url,weather_icon) (ariadne_jenkins_build_weather_job_last_status < 0)", "legendFormat": "{{weather_icon}} {{exported_job}}", "instant": true } @@ -2573,8 +2567,8 @@ }, "textMode": "name_and_value", "text": { - "titleSize": 11, - "valueSize": 11 + "titleSize": 12, + "valueSize": 12 } }, "transformations": [ @@ -2586,12 +2580,6 @@ ], "order": "asc" } - }, - { - "id": "limit", - "options": { - "limit": 6 - } } ], "links": [ diff --git a/services/monitoring/grafana-dashboard-overview.yaml b/services/monitoring/grafana-dashboard-overview.yaml index 4e9b7f79..22b8f64c 100644 --- a/services/monitoring/grafana-dashboard-overview.yaml +++ b/services/monitoring/grafana-dashboard-overview.yaml @@ -2307,25 +2307,25 @@ data: "targets": [ { "refId": "A", - "expr": "((time() - ariadne_jenkins_build_weather_job_last_success_timestamp_seconds) / 3600) and on(exported_job,job_url,weather_icon) (ariadne_jenkins_build_weather_job_last_status == 1)", + "expr": "(sort(bottomk(6, (time() - ariadne_jenkins_build_weather_job_last_success_timestamp_seconds) / 3600))) and on(exported_job,job_url,weather_icon) (ariadne_jenkins_build_weather_job_last_status == 1)", "legendFormat": "{{weather_icon}} {{exported_job}}", "instant": true }, { "refId": "B", - "expr": "((time() - ariadne_jenkins_build_weather_job_last_success_timestamp_seconds) / 3600) and on(exported_job,job_url,weather_icon) (ariadne_jenkins_build_weather_job_last_status == 0)", + "expr": "(sort(bottomk(6, (time() - ariadne_jenkins_build_weather_job_last_success_timestamp_seconds) / 3600))) and on(exported_job,job_url,weather_icon) (ariadne_jenkins_build_weather_job_last_status == 0)", "legendFormat": "{{weather_icon}} {{exported_job}}", "instant": true }, { "refId": "C", - "expr": "((time() - ariadne_jenkins_build_weather_job_last_success_timestamp_seconds) / 3600) and on(exported_job,job_url,weather_icon) (ariadne_jenkins_build_weather_job_last_status == 2)", + "expr": "(sort(bottomk(6, (time() - ariadne_jenkins_build_weather_job_last_success_timestamp_seconds) / 3600))) and on(exported_job,job_url,weather_icon) (ariadne_jenkins_build_weather_job_last_status == 2)", "legendFormat": "{{weather_icon}} {{exported_job}}", "instant": true }, { "refId": "D", - "expr": "((time() - ariadne_jenkins_build_weather_job_last_success_timestamp_seconds) / 3600) and on(exported_job,job_url,weather_icon) (ariadne_jenkins_build_weather_job_last_status < 0)", + "expr": "(sort(bottomk(6, (time() - ariadne_jenkins_build_weather_job_last_success_timestamp_seconds) / 3600))) and on(exported_job,job_url,weather_icon) (ariadne_jenkins_build_weather_job_last_status < 0)", "legendFormat": "{{weather_icon}} {{exported_job}}", "instant": true } @@ -2421,8 +2421,8 @@ data: }, "textMode": "name_and_value", "text": { - "titleSize": 11, - "valueSize": 11 + "titleSize": 12, + "valueSize": 12 } }, "transformations": [ @@ -2434,12 +2434,6 @@ data: ], "order": "asc" } - }, - { - "id": "limit", - "options": { - "limit": 6 - } } ], "links": [ @@ -2468,25 +2462,25 @@ data: "targets": [ { "refId": "A", - "expr": "((time() - ariadne_jenkins_build_weather_job_last_failure_timestamp_seconds) / 3600) and on(exported_job,job_url,weather_icon) (ariadne_jenkins_build_weather_job_last_status == 1)", + "expr": "(sort(bottomk(6, (time() - ariadne_jenkins_build_weather_job_last_failure_timestamp_seconds) / 3600))) and on(exported_job,job_url,weather_icon) (ariadne_jenkins_build_weather_job_last_status == 1)", "legendFormat": "{{weather_icon}} {{exported_job}}", "instant": true }, { "refId": "B", - "expr": "((time() - ariadne_jenkins_build_weather_job_last_failure_timestamp_seconds) / 3600) and on(exported_job,job_url,weather_icon) (ariadne_jenkins_build_weather_job_last_status == 0)", + "expr": "(sort(bottomk(6, (time() - ariadne_jenkins_build_weather_job_last_failure_timestamp_seconds) / 3600))) and on(exported_job,job_url,weather_icon) (ariadne_jenkins_build_weather_job_last_status == 0)", "legendFormat": "{{weather_icon}} {{exported_job}}", "instant": true }, { "refId": "C", - "expr": "((time() - ariadne_jenkins_build_weather_job_last_failure_timestamp_seconds) / 3600) and on(exported_job,job_url,weather_icon) (ariadne_jenkins_build_weather_job_last_status == 2)", + "expr": "(sort(bottomk(6, (time() - ariadne_jenkins_build_weather_job_last_failure_timestamp_seconds) / 3600))) and on(exported_job,job_url,weather_icon) (ariadne_jenkins_build_weather_job_last_status == 2)", "legendFormat": "{{weather_icon}} {{exported_job}}", "instant": true }, { "refId": "D", - "expr": "((time() - ariadne_jenkins_build_weather_job_last_failure_timestamp_seconds) / 3600) and on(exported_job,job_url,weather_icon) (ariadne_jenkins_build_weather_job_last_status < 0)", + "expr": "(sort(bottomk(6, (time() - ariadne_jenkins_build_weather_job_last_failure_timestamp_seconds) / 3600))) and on(exported_job,job_url,weather_icon) (ariadne_jenkins_build_weather_job_last_status < 0)", "legendFormat": "{{weather_icon}} {{exported_job}}", "instant": true } @@ -2582,8 +2576,8 @@ data: }, "textMode": "name_and_value", "text": { - "titleSize": 11, - "valueSize": 11 + "titleSize": 12, + "valueSize": 12 } }, "transformations": [ @@ -2595,12 +2589,6 @@ data: ], "order": "asc" } - }, - { - "id": "limit", - "options": { - "limit": 6 - } } ], "links": [