From ea3366c913251f6330e8a3b8538a7df3629519b2 Mon Sep 17 00:00:00 2001 From: jenkins Date: Sun, 17 May 2026 18:01:37 -0300 Subject: [PATCH] monitoring(overview): restore category timeline --- scripts/dashboards_render_atlas.py | 49 ++----- scripts/tests/test_dashboards_render_atlas.py | 21 ++- .../monitoring/dashboards/atlas-overview.json | 131 +++--------------- .../grafana-dashboard-overview.yaml | 131 +++--------------- 4 files changed, 66 insertions(+), 266 deletions(-) diff --git a/scripts/dashboards_render_atlas.py b/scripts/dashboards_render_atlas.py index f4d0bf76..a3987dda 100644 --- a/scripts/dashboards_render_atlas.py +++ b/scripts/dashboards_render_atlas.py @@ -1324,36 +1324,6 @@ def testing_suite_variable(): } -def overview_testing_suite_variable(): - preferred = "$__all" - options = [{"text": "All", "value": "$__all", "selected": True}] - options.extend( - { - "text": suite, - "value": suite, - "selected": False, - } - for suite in PLATFORM_TEST_SUITE_NAMES - ) - return { - "name": "overview_suite", - "label": "Testing Suite", - "type": "custom", - "query": ",".join(f"{suite} : {suite}" for suite in PLATFORM_TEST_SUITE_NAMES), - "current": {"text": "All", "value": preferred, "selected": True}, - "options": options, - # Grafana variables are dashboard-scoped controls; hide this one because only the - # Test Category Pass Rate panel consumes it. - "hide": 2, - "multi": False, - "includeAll": True, - "allValue": PLATFORM_TEST_SUITE_CANONICAL_MATCHER, - "refresh": 1, - "sort": 1, - "skipUrlSync": False, - } - - def testing_case_variable(): return { "name": "test", @@ -1658,7 +1628,7 @@ OVERVIEW_PANEL_DESCRIPTIONS = { "GitOps Health": "Flux readiness and suspension health over time; blue is perfect, warmer colors mean drift or pause.", "One-off Job Pods (age hours)": "Temporary job pods by age; low or empty is good, old pods usually need cleanup.", "Ariadne Run Volume": "Ariadne automation attempts and failures; attempts show activity, failures show work to investigate.", - "Test Category Pass Rate": "Pass rate by test category for the selected suite; blue means clean categories, warmer colors show problem areas.", + "Test Category Pass Rate": "Pass rate by test category across all suites; blue means clean categories, warmer colors show problem areas.", "Jenkins Last Success (h, newest first)": "Age of recent Jenkins successes; lower is fresher and better.", "Jenkins Last Failure (h, newest first)": "Age of recent Jenkins failures; lower means a failure happened more recently.", "PVC Backup Health / Age": "Restic backup age by PVC; lower is better, very old backups mean restore risk.", @@ -2096,7 +2066,7 @@ def build_overview(): overview_loc_clean_suites = f"(sum(({QUALITY_GATE_SMELL_INFRACTIONS_BY_SUITE}) == bool 0) or on() vector(0))" overview_category_pass_rate = ( 'avg by (category) (platform_quality:test_case_pass_rate:percent_1h{' - 'suite=~"${overview_suite:regex}",branch!="",branch=~"main|master|origin/main|origin/master",' + f'suite=~"{PLATFORM_TEST_SUITE_CANONICAL_MATCHER}",branch!="",branch=~"main|master|origin/main|origin/master",' f'test!="",test!="__no_test_cases__",category!="",category!~"uncategorized|{PLATFORM_TEST_SUPPORT_CATEGORY_REGEX}"' "})" ) @@ -2429,21 +2399,25 @@ def build_overview(): ) panels.append(apply_bar_timeseries_style(ariadne_volume, stacked=False)) panels.append( - bargauge_panel( + state_timeline_panel( 46, "Test Category Pass Rate", overview_category_pass_rate, {"h": 6, "w": 6, "x": 15, "y": 13}, unit="percent", - instant=True, + min_value=0, + max_value=100, legend="{{category}}", - sort_order="asc", thresholds=test_success_thresholds, - decimals=1, links=overview_link("atlas-testing"), - description="Current pass rate by test category for the selected suite set. Blue is clean; warmer colors show categories needing attention.", + description="Pass rate by test category across all suites over the selected time range. Blue is clean; warmer colors show categories needing attention.", ) ) + panels[-1]["options"]["legend"] = {"displayMode": "list", "placement": "bottom", "showLegend": False} + panels[-1]["options"]["mergeValues"] = False + panels[-1]["options"]["showValue"] = "auto" + panels[-1]["options"]["tooltip"] = {"mode": "multi", "sort": "none"} + panels[-1]["options"]["rowHeight"] = 0.9 for panel_id, title, metric, x_pos, description in [ ( 142, @@ -2867,7 +2841,6 @@ def build_overview(): namespace_scope_variable("namespace_scope_cpu", "CPU namespace filter"), namespace_scope_variable("namespace_scope_gpu", "GPU namespace filter"), namespace_scope_variable("namespace_scope_ram", "RAM namespace filter"), - overview_testing_suite_variable(), ] }, "time": {"from": "now-1h", "to": "now"}, diff --git a/scripts/tests/test_dashboards_render_atlas.py b/scripts/tests/test_dashboards_render_atlas.py index eb326faf..1b3cc09e 100644 --- a/scripts/tests/test_dashboards_render_atlas.py +++ b/scripts/tests/test_dashboards_render_atlas.py @@ -72,10 +72,11 @@ def test_overview_uses_readable_quality_power_and_gitops_panels(): ] assert "atlas-jobs" not in repr(dashboard) assert "Platform Test Success Rate" not in panels_by_title - assert panels_by_title["Test Category Pass Rate"]["type"] == "bargauge" + assert panels_by_title["Test Category Pass Rate"]["type"] == "state-timeline" assert panels_by_title["Test Category Pass Rate"]["gridPos"] == {"h": 6, "w": 6, "x": 15, "y": 13} assert panels_by_title["Test Category Pass Rate"]["targets"][0]["legendFormat"] == "{{category}}" - assert "${overview_suite:regex}" in panels_by_title["Test Category Pass Rate"]["targets"][0]["expr"] + assert "${overview_suite:regex}" not in panels_by_title["Test Category Pass Rate"]["targets"][0]["expr"] + assert mod.PLATFORM_TEST_SUITE_CANONICAL_MATCHER in panels_by_title["Test Category Pass Rate"]["targets"][0]["expr"] assert panels_by_title["UPS History (Power Draw)"]["gridPos"] == {"h": 6, "w": 6, "x": 3, "y": 7} assert panels_by_title["Ariadne Run Volume"]["gridPos"] == {"h": 6, "w": 6, "x": 9, "y": 7} assert panels_by_title["Pyrphoros UPS Current"]["gridPos"]["w"] == 3 @@ -131,17 +132,13 @@ def test_overview_uses_readable_quality_power_and_gitops_panels(): gitops_expr = panels_by_title["GitOps Health"]["targets"][0]["expr"] assert "Kustomizations Not Suspended" in gitops_expr assert "HelmReleases Not Suspended" in gitops_expr - assert panels_by_title["Test Category Pass Rate"]["type"] == "bargauge" - assert panels_by_title["Test Category Pass Rate"]["options"]["orientation"] == "horizontal" - assert panels_by_title["Test Category Pass Rate"]["targets"][0]["instant"] is True + assert panels_by_title["Test Category Pass Rate"]["type"] == "state-timeline" + assert panels_by_title["Test Category Pass Rate"]["options"]["legend"]["showLegend"] is False + assert panels_by_title["Test Category Pass Rate"]["options"]["mergeValues"] is False + assert panels_by_title["Test Category Pass Rate"]["options"]["showValue"] == "auto" + assert panels_by_title["Test Category Pass Rate"]["options"]["rowHeight"] == 0.9 assert panels_by_title["Test Category Pass Rate"]["targets"][0]["legendFormat"] == "{{category}}" - assert panels_by_title["Test Category Pass Rate"]["transformations"][0]["id"] == "sortBy" - assert panels_by_title["Test Category Pass Rate"]["transformations"][0]["options"]["order"] == "asc" - overview_suite = next(variable for variable in dashboard["templating"]["list"] if variable["name"] == "overview_suite") - assert overview_suite["current"] == {"text": "All", "value": "$__all", "selected": True} - assert overview_suite["includeAll"] is True - assert overview_suite["allValue"] == mod.PLATFORM_TEST_SUITE_CANONICAL_MATCHER - assert overview_suite["hide"] == 2 + assert not any(variable["name"] == "overview_suite" for variable in dashboard["templating"]["list"]) pvc_backup_expr = panels_by_title["PVC Backup Health / Age"]["targets"][0]["expr"] assert "backup-telemetry-missing" in pvc_backup_expr diff --git a/services/monitoring/dashboards/atlas-overview.json b/services/monitoring/dashboards/atlas-overview.json index 88b2811d..e085bf6d 100644 --- a/services/monitoring/dashboards/atlas-overview.json +++ b/services/monitoring/dashboards/atlas-overview.json @@ -2794,8 +2794,9 @@ }, { "id": 46, - "type": "bargauge", + "type": "state-timeline", "title": "Test Category Pass Rate", + "description": "Pass rate by test category across all suites over the selected time range. Blue is clean; warmer colors show categories needing attention.", "datasource": { "type": "prometheus", "uid": "atlas-vm" @@ -2808,10 +2809,9 @@ }, "targets": [ { - "expr": "sort(avg by (category) (platform_quality:test_case_pass_rate:percent_1h{suite=~\"${overview_suite:regex}\",branch!=\"\",branch=~\"main|master|origin/main|origin/master\",test!=\"\",test!=\"__no_test_cases__\",category!=\"\",category!~\"uncategorized|fixtures|golden|helpers\"}))", + "expr": "avg by (category) (platform_quality:test_case_pass_rate:percent_1h{suite=~\"ariadne|metis|ananke|atlasbot|lesavka|pegasus|soteria|titan_iac|typhon|bstein_home|data_prepper\",branch!=\"\",branch=~\"main|master|origin/main|origin/master\",test!=\"\",test!=\"__no_test_cases__\",category!=\"\",category!~\"uncategorized|fixtures|golden|helpers\"})", "refId": "A", - "legendFormat": "{{category}}", - "instant": true + "legendFormat": "{{category}}" } ], "fieldConfig": { @@ -2820,8 +2820,6 @@ "mode": "thresholds" }, "unit": "percent", - "min": 0, - "max": 100, "thresholds": { "mode": "absolute", "steps": [ @@ -2847,20 +2845,29 @@ } ] }, - "decimals": 1 + "custom": { + "fillOpacity": 70, + "lineWidth": 0, + "spanNulls": true + }, + "min": 0, + "max": 100 }, "overrides": [] }, "options": { - "displayMode": "basic", - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - } + "mergeValues": false, + "showValue": "auto", + "legend": { + "displayMode": "list", + "placement": "bottom", + "showLegend": false + }, + "tooltip": { + "mode": "multi", + "sort": "none" + }, + "rowHeight": 0.9 }, "links": [ { @@ -2868,18 +2875,6 @@ "url": "/d/atlas-testing", "targetBlank": true } - ], - "description": "Current pass rate by test category for the selected suite set. Blue is clean; warmer colors show categories needing attention.", - "transformations": [ - { - "id": "sortBy", - "options": { - "fields": [ - "Value" - ], - "order": "asc" - } - } ] }, { @@ -4490,86 +4485,6 @@ "refresh": 1, "sort": 0, "skipUrlSync": false - }, - { - "name": "overview_suite", - "label": "Testing Suite", - "type": "custom", - "query": "ariadne : ariadne,metis : metis,ananke : ananke,atlasbot : atlasbot,lesavka : lesavka,pegasus : pegasus,soteria : soteria,titan_iac : titan_iac,typhon : typhon,bstein_home : bstein_home,data_prepper : data_prepper", - "current": { - "text": "All", - "value": "$__all", - "selected": true - }, - "options": [ - { - "text": "All", - "value": "$__all", - "selected": true - }, - { - "text": "ariadne", - "value": "ariadne", - "selected": false - }, - { - "text": "metis", - "value": "metis", - "selected": false - }, - { - "text": "ananke", - "value": "ananke", - "selected": false - }, - { - "text": "atlasbot", - "value": "atlasbot", - "selected": false - }, - { - "text": "lesavka", - "value": "lesavka", - "selected": false - }, - { - "text": "pegasus", - "value": "pegasus", - "selected": false - }, - { - "text": "soteria", - "value": "soteria", - "selected": false - }, - { - "text": "titan_iac", - "value": "titan_iac", - "selected": false - }, - { - "text": "typhon", - "value": "typhon", - "selected": false - }, - { - "text": "bstein_home", - "value": "bstein_home", - "selected": false - }, - { - "text": "data_prepper", - "value": "data_prepper", - "selected": false - } - ], - "hide": 2, - "multi": false, - "includeAll": true, - "allValue": "ariadne|metis|ananke|atlasbot|lesavka|pegasus|soteria|titan_iac|typhon|bstein_home|data_prepper", - "refresh": 1, - "sort": 1, - "skipUrlSync": false } ] }, diff --git a/services/monitoring/grafana-dashboard-overview.yaml b/services/monitoring/grafana-dashboard-overview.yaml index 8b3b1643..3e414783 100644 --- a/services/monitoring/grafana-dashboard-overview.yaml +++ b/services/monitoring/grafana-dashboard-overview.yaml @@ -2803,8 +2803,9 @@ data: }, { "id": 46, - "type": "bargauge", + "type": "state-timeline", "title": "Test Category Pass Rate", + "description": "Pass rate by test category across all suites over the selected time range. Blue is clean; warmer colors show categories needing attention.", "datasource": { "type": "prometheus", "uid": "atlas-vm" @@ -2817,10 +2818,9 @@ data: }, "targets": [ { - "expr": "sort(avg by (category) (platform_quality:test_case_pass_rate:percent_1h{suite=~\"${overview_suite:regex}\",branch!=\"\",branch=~\"main|master|origin/main|origin/master\",test!=\"\",test!=\"__no_test_cases__\",category!=\"\",category!~\"uncategorized|fixtures|golden|helpers\"}))", + "expr": "avg by (category) (platform_quality:test_case_pass_rate:percent_1h{suite=~\"ariadne|metis|ananke|atlasbot|lesavka|pegasus|soteria|titan_iac|typhon|bstein_home|data_prepper\",branch!=\"\",branch=~\"main|master|origin/main|origin/master\",test!=\"\",test!=\"__no_test_cases__\",category!=\"\",category!~\"uncategorized|fixtures|golden|helpers\"})", "refId": "A", - "legendFormat": "{{category}}", - "instant": true + "legendFormat": "{{category}}" } ], "fieldConfig": { @@ -2829,8 +2829,6 @@ data: "mode": "thresholds" }, "unit": "percent", - "min": 0, - "max": 100, "thresholds": { "mode": "absolute", "steps": [ @@ -2856,20 +2854,29 @@ data: } ] }, - "decimals": 1 + "custom": { + "fillOpacity": 70, + "lineWidth": 0, + "spanNulls": true + }, + "min": 0, + "max": 100 }, "overrides": [] }, "options": { - "displayMode": "basic", - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - } + "mergeValues": false, + "showValue": "auto", + "legend": { + "displayMode": "list", + "placement": "bottom", + "showLegend": false + }, + "tooltip": { + "mode": "multi", + "sort": "none" + }, + "rowHeight": 0.9 }, "links": [ { @@ -2877,18 +2884,6 @@ data: "url": "/d/atlas-testing", "targetBlank": true } - ], - "description": "Current pass rate by test category for the selected suite set. Blue is clean; warmer colors show categories needing attention.", - "transformations": [ - { - "id": "sortBy", - "options": { - "fields": [ - "Value" - ], - "order": "asc" - } - } ] }, { @@ -4499,86 +4494,6 @@ data: "refresh": 1, "sort": 0, "skipUrlSync": false - }, - { - "name": "overview_suite", - "label": "Testing Suite", - "type": "custom", - "query": "ariadne : ariadne,metis : metis,ananke : ananke,atlasbot : atlasbot,lesavka : lesavka,pegasus : pegasus,soteria : soteria,titan_iac : titan_iac,typhon : typhon,bstein_home : bstein_home,data_prepper : data_prepper", - "current": { - "text": "All", - "value": "$__all", - "selected": true - }, - "options": [ - { - "text": "All", - "value": "$__all", - "selected": true - }, - { - "text": "ariadne", - "value": "ariadne", - "selected": false - }, - { - "text": "metis", - "value": "metis", - "selected": false - }, - { - "text": "ananke", - "value": "ananke", - "selected": false - }, - { - "text": "atlasbot", - "value": "atlasbot", - "selected": false - }, - { - "text": "lesavka", - "value": "lesavka", - "selected": false - }, - { - "text": "pegasus", - "value": "pegasus", - "selected": false - }, - { - "text": "soteria", - "value": "soteria", - "selected": false - }, - { - "text": "titan_iac", - "value": "titan_iac", - "selected": false - }, - { - "text": "typhon", - "value": "typhon", - "selected": false - }, - { - "text": "bstein_home", - "value": "bstein_home", - "selected": false - }, - { - "text": "data_prepper", - "value": "data_prepper", - "selected": false - } - ], - "hide": 2, - "multi": false, - "includeAll": true, - "allValue": "ariadne|metis|ananke|atlasbot|lesavka|pegasus|soteria|titan_iac|typhon|bstein_home|data_prepper", - "refresh": 1, - "sort": 1, - "skipUrlSync": false } ] },