From 4fd8a00d4a176bcd5c9d42453c0928aaa76c73f2 Mon Sep 17 00:00:00 2001 From: jenkins Date: Fri, 5 Jun 2026 13:22:29 -0300 Subject: [PATCH] monitoring(testing): cap history panel ranges --- scripts/dashboards_render_atlas.py | 84 ++++++++++--------- .../monitoring/dashboards/atlas-testing.json | 53 ++++++++---- .../monitoring/grafana-dashboard-testing.yaml | 53 ++++++++---- 3 files changed, 116 insertions(+), 74 deletions(-) diff --git a/scripts/dashboards_render_atlas.py b/scripts/dashboards_render_atlas.py index 04fbb1df..a8cd8f9d 100644 --- a/scripts/dashboards_render_atlas.py +++ b/scripts/dashboards_render_atlas.py @@ -4492,6 +4492,7 @@ def build_jobs_dashboard(): legend_display="list", legend_placement="bottom", legend_calcs=[], + time_from=PLATFORM_TEST_HISTORY_WINDOW, ) run_volume_panel["description"] = ( "Twenty-four-hour rolling quality-gate run counts for the selected suite/branch scope. " @@ -4507,32 +4508,32 @@ def build_jobs_dashboard(): } panels.append(run_volume_panel) - panels.append( - state_timeline_panel( - 13, - "Coverage History by Suite", - coverage_history_by_suite, - {"h": 8, "w": 8, "x": 8, "y": 21}, - thresholds=coverage_thresholds, - description=( - "Latest reported line coverage per suite over time. Coverage is separate " - "from LOC compliance so one signal cannot hide the other." - ), - ) + coverage_history_panel = state_timeline_panel( + 13, + "Coverage History by Suite", + coverage_history_by_suite, + {"h": 8, "w": 8, "x": 8, "y": 21}, + thresholds=coverage_thresholds, + description=( + "Latest reported line coverage per suite over time. Coverage is separate " + "from LOC compliance so one signal cannot hide the other." + ), ) - panels.append( - state_timeline_panel( - 14, - "Files <=500 LOC History by Suite", - loc_limit_compliance_history, - {"h": 8, "w": 8, "x": 16, "y": 21}, - thresholds=success_thresholds, - description=( - "Percent of LOC-gated source files at or under the 500-line limit. " - "This uses the existing file-count telemetry; longest-file history needs a new publisher metric." - ), - ) + coverage_history_panel["timeFrom"] = PLATFORM_TEST_HISTORY_WINDOW + panels.append(coverage_history_panel) + loc_history_panel = state_timeline_panel( + 14, + "Files <=500 LOC History by Suite", + loc_limit_compliance_history, + {"h": 8, "w": 8, "x": 16, "y": 21}, + thresholds=success_thresholds, + description=( + "Percent of LOC-gated source files at or under the 500-line limit. " + "This uses the existing file-count telemetry; longest-file history needs a new publisher metric." + ), ) + loc_history_panel["timeFrom"] = PLATFORM_TEST_HISTORY_WINDOW + panels.append(loc_history_panel) check_dimensions = [ ("Tests", check_regex_tests), @@ -4562,6 +4563,7 @@ def build_jobs_dashboard(): thresholds=trend_thresholds, description=trend_description, ) + panel["timeFrom"] = PLATFORM_TEST_HISTORY_WINDOW panels.append(panel) for index, (label, regex) in enumerate(check_dimensions[4:]): panel = state_timeline_panel( @@ -4572,6 +4574,7 @@ def build_jobs_dashboard(): thresholds=trend_thresholds, description=trend_description, ) + panel["timeFrom"] = PLATFORM_TEST_HISTORY_WINDOW panels.append(panel) _append_check_trends(130, "Failure Rate", True, 29) @@ -4672,6 +4675,7 @@ def build_jobs_dashboard(): "project; skipped tests are healthy, while failures and errors lower the lane." ), ) + category_pass_rate_panel["timeFrom"] = PLATFORM_TEST_HISTORY_WINDOW category_pass_rate_panel["links"] = jenkins_suite_links() panels.append(category_pass_rate_panel) @@ -4813,23 +4817,23 @@ def build_jobs_dashboard(): ) sonar_status_mix_panel["targets"][0]["legendFormat"] = "{{status}}" panels.append(sonar_status_mix_panel) - panels.append( - state_timeline_panel( - 35, - "Sonar Gate Health by Project", - f'{PLATFORM_TEST_SONAR_HEALTH_ROLLUP}{{project_key=~"{suite_var}"}}', - {"h": 6, "w": 8, "x": 16, "y": 88}, - thresholds=success_thresholds, - unit="percent", - min_value=0, - max_value=100, - legend="{{project_key}}", - description=( - "SonarQube gate status over time by project. OK projects render as full healthy lanes; " - "non-OK projects drop to red without disappearing." - ), - ) + sonar_gate_project_panel = state_timeline_panel( + 35, + "Sonar Gate Health by Project", + f'{PLATFORM_TEST_SONAR_HEALTH_ROLLUP}{{project_key=~"{suite_var}"}}', + {"h": 6, "w": 8, "x": 16, "y": 88}, + thresholds=success_thresholds, + unit="percent", + min_value=0, + max_value=100, + legend="{{project_key}}", + description=( + "SonarQube gate status over time by project. OK projects render as full healthy lanes; " + "non-OK projects drop to red without disappearing." + ), ) + sonar_gate_project_panel["timeFrom"] = PLATFORM_TEST_HISTORY_WINDOW + panels.append(sonar_gate_project_panel) panels.append( bargauge_panel( 148, diff --git a/services/monitoring/dashboards/atlas-testing.json b/services/monitoring/dashboards/atlas-testing.json index f2d1efec..c6c9e26a 100644 --- a/services/monitoring/dashboards/atlas-testing.json +++ b/services/monitoring/dashboards/atlas-testing.json @@ -1131,6 +1131,7 @@ "sort": "none" } }, + "timeFrom": "7d", "links": [ { "title": "Open Jenkins", @@ -1291,6 +1292,7 @@ "mode": "multi" } }, + "timeFrom": "7d", "description": "Twenty-four-hour rolling quality-gate run counts for the selected suite/branch scope. This is volume, not a pass-rate percentage." }, { @@ -1370,7 +1372,8 @@ "mode": "single", "sort": "none" } - } + }, + "timeFrom": "7d" }, { "id": 14, @@ -1449,7 +1452,8 @@ "mode": "single", "sort": "none" } - } + }, + "timeFrom": "7d" } ], "description": "Recent CI run, coverage, LOC, and raw test-result trends for selected suites." @@ -1543,7 +1547,8 @@ "mode": "single", "sort": "none" } - } + }, + "timeFrom": "7d" }, { "id": 131, @@ -1622,7 +1627,8 @@ "mode": "single", "sort": "none" } - } + }, + "timeFrom": "7d" }, { "id": 132, @@ -1701,7 +1707,8 @@ "mode": "single", "sort": "none" } - } + }, + "timeFrom": "7d" }, { "id": 133, @@ -1780,7 +1787,8 @@ "mode": "single", "sort": "none" } - } + }, + "timeFrom": "7d" }, { "id": 134, @@ -1859,7 +1867,8 @@ "mode": "single", "sort": "none" } - } + }, + "timeFrom": "7d" }, { "id": 135, @@ -1938,7 +1947,8 @@ "mode": "single", "sort": "none" } - } + }, + "timeFrom": "7d" }, { "id": 136, @@ -2017,7 +2027,8 @@ "mode": "single", "sort": "none" } - } + }, + "timeFrom": "7d" } ], "description": "Failure percent by check family; blue is zero failures, warmer colors show blockers." @@ -2111,7 +2122,8 @@ "mode": "single", "sort": "none" } - } + }, + "timeFrom": "7d" }, { "id": 139, @@ -2190,7 +2202,8 @@ "mode": "single", "sort": "none" } - } + }, + "timeFrom": "7d" }, { "id": 140, @@ -2269,7 +2282,8 @@ "mode": "single", "sort": "none" } - } + }, + "timeFrom": "7d" }, { "id": 141, @@ -2348,7 +2362,8 @@ "mode": "single", "sort": "none" } - } + }, + "timeFrom": "7d" }, { "id": 142, @@ -2427,7 +2442,8 @@ "mode": "single", "sort": "none" } - } + }, + "timeFrom": "7d" }, { "id": 143, @@ -2506,7 +2522,8 @@ "mode": "single", "sort": "none" } - } + }, + "timeFrom": "7d" }, { "id": 144, @@ -2585,7 +2602,8 @@ "mode": "single", "sort": "none" } - } + }, + "timeFrom": "7d" } ], "description": "Healthy percent by check family; blue means all selected checks are good." @@ -4620,7 +4638,8 @@ "mode": "single", "sort": "none" } - } + }, + "timeFrom": "7d" } ], "description": "SonarQube availability, projects, fetch errors, and gate status." diff --git a/services/monitoring/grafana-dashboard-testing.yaml b/services/monitoring/grafana-dashboard-testing.yaml index a7307388..961d34b0 100644 --- a/services/monitoring/grafana-dashboard-testing.yaml +++ b/services/monitoring/grafana-dashboard-testing.yaml @@ -1140,6 +1140,7 @@ data: "sort": "none" } }, + "timeFrom": "7d", "links": [ { "title": "Open Jenkins", @@ -1300,6 +1301,7 @@ data: "mode": "multi" } }, + "timeFrom": "7d", "description": "Twenty-four-hour rolling quality-gate run counts for the selected suite/branch scope. This is volume, not a pass-rate percentage." }, { @@ -1379,7 +1381,8 @@ data: "mode": "single", "sort": "none" } - } + }, + "timeFrom": "7d" }, { "id": 14, @@ -1458,7 +1461,8 @@ data: "mode": "single", "sort": "none" } - } + }, + "timeFrom": "7d" } ], "description": "Recent CI run, coverage, LOC, and raw test-result trends for selected suites." @@ -1552,7 +1556,8 @@ data: "mode": "single", "sort": "none" } - } + }, + "timeFrom": "7d" }, { "id": 131, @@ -1631,7 +1636,8 @@ data: "mode": "single", "sort": "none" } - } + }, + "timeFrom": "7d" }, { "id": 132, @@ -1710,7 +1716,8 @@ data: "mode": "single", "sort": "none" } - } + }, + "timeFrom": "7d" }, { "id": 133, @@ -1789,7 +1796,8 @@ data: "mode": "single", "sort": "none" } - } + }, + "timeFrom": "7d" }, { "id": 134, @@ -1868,7 +1876,8 @@ data: "mode": "single", "sort": "none" } - } + }, + "timeFrom": "7d" }, { "id": 135, @@ -1947,7 +1956,8 @@ data: "mode": "single", "sort": "none" } - } + }, + "timeFrom": "7d" }, { "id": 136, @@ -2026,7 +2036,8 @@ data: "mode": "single", "sort": "none" } - } + }, + "timeFrom": "7d" } ], "description": "Failure percent by check family; blue is zero failures, warmer colors show blockers." @@ -2120,7 +2131,8 @@ data: "mode": "single", "sort": "none" } - } + }, + "timeFrom": "7d" }, { "id": 139, @@ -2199,7 +2211,8 @@ data: "mode": "single", "sort": "none" } - } + }, + "timeFrom": "7d" }, { "id": 140, @@ -2278,7 +2291,8 @@ data: "mode": "single", "sort": "none" } - } + }, + "timeFrom": "7d" }, { "id": 141, @@ -2357,7 +2371,8 @@ data: "mode": "single", "sort": "none" } - } + }, + "timeFrom": "7d" }, { "id": 142, @@ -2436,7 +2451,8 @@ data: "mode": "single", "sort": "none" } - } + }, + "timeFrom": "7d" }, { "id": 143, @@ -2515,7 +2531,8 @@ data: "mode": "single", "sort": "none" } - } + }, + "timeFrom": "7d" }, { "id": 144, @@ -2594,7 +2611,8 @@ data: "mode": "single", "sort": "none" } - } + }, + "timeFrom": "7d" } ], "description": "Healthy percent by check family; blue means all selected checks are good." @@ -4629,7 +4647,8 @@ data: "mode": "single", "sort": "none" } - } + }, + "timeFrom": "7d" } ], "description": "SonarQube availability, projects, fetch errors, and gate status."