diff --git a/scripts/dashboards_render_atlas.py b/scripts/dashboards_render_atlas.py index 0014c08f..4a1f9290 100644 --- a/scripts/dashboards_render_atlas.py +++ b/scripts/dashboards_render_atlas.py @@ -505,6 +505,12 @@ JENKINS_BUILD_WEATHER_LAST_SUCCESS_AGE_HOURS_BY_JOB = ( JENKINS_BUILD_WEATHER_LAST_FAILURE_AGE_HOURS_BY_JOB = ( f"min by (exported_job,job_url,weather_icon) ({JENKINS_BUILD_WEATHER_LAST_FAILURE_AGE_HOURS})" ) +JENKINS_BUILD_WEATHER_LAST_SUCCESS_TOP6_AGE_HOURS_BY_JOB = ( + f"sort(bottomk(6, {JENKINS_BUILD_WEATHER_LAST_SUCCESS_AGE_HOURS_BY_JOB}))" +) +JENKINS_BUILD_WEATHER_LAST_FAILURE_TOP6_AGE_HOURS_BY_JOB = ( + f"sort(bottomk(6, {JENKINS_BUILD_WEATHER_LAST_FAILURE_AGE_HOURS_BY_JOB}))" +) JENKINS_BUILD_WEATHER_LAST_DURATION_MINUTES = ( "ariadne_jenkins_build_weather_job_last_duration_seconds / 60" ) @@ -2192,12 +2198,12 @@ def build_overview(): jenkins_weather_statlist_panel( 142, "Jenkins Last Success (h, newest first)", - JENKINS_BUILD_WEATHER_LAST_SUCCESS_AGE_HOURS_BY_JOB, + JENKINS_BUILD_WEATHER_LAST_SUCCESS_TOP6_AGE_HOURS_BY_JOB, {"h": 5, "w": 4, "x": 8, "y": 32}, unit="h", decimals=1, sort_order="asc", - limit=6, + limit=None, title_size=11, value_size=11, links=link_to("atlas-jobs"), @@ -2212,12 +2218,12 @@ def build_overview(): jenkins_weather_statlist_panel( 243, "Jenkins Last Failure (h, newest first)", - JENKINS_BUILD_WEATHER_LAST_FAILURE_AGE_HOURS_BY_JOB, + JENKINS_BUILD_WEATHER_LAST_FAILURE_TOP6_AGE_HOURS_BY_JOB, {"h": 5, "w": 4, "x": 12, "y": 32}, unit="h", decimals=1, sort_order="asc", - limit=6, + limit=None, title_size=11, value_size=11, links=link_to("atlas-jobs"), diff --git a/services/monitoring/dashboards/atlas-overview.json b/services/monitoring/dashboards/atlas-overview.json index eab52244..c64dcdd1 100644 --- a/services/monitoring/dashboards/atlas-overview.json +++ b/services/monitoring/dashboards/atlas-overview.json @@ -2298,25 +2298,25 @@ "targets": [ { "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)", + "expr": "(sort(bottomk(6, 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)", "legendFormat": "{{weather_icon}} {{exported_job}}", "instant": true }, { "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) == 0)", + "expr": "(sort(bottomk(6, 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) == 0)", "legendFormat": "{{weather_icon}} {{exported_job}}", "instant": true }, { "refId": "C", - "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) == 2)", + "expr": "(sort(bottomk(6, 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) == 2)", "legendFormat": "{{weather_icon}} {{exported_job}}", "instant": true }, { "refId": "D", - "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) < 0)", + "expr": "(sort(bottomk(6, 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) < 0)", "legendFormat": "{{weather_icon}} {{exported_job}}", "instant": true } @@ -2425,12 +2425,6 @@ ], "order": "asc" } - }, - { - "id": "limit", - "options": { - "limit": 6 - } } ], "links": [ @@ -2459,25 +2453,25 @@ "targets": [ { "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)", + "expr": "(sort(bottomk(6, 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)", "legendFormat": "{{weather_icon}} {{exported_job}}", "instant": true }, { "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) == 0)", + "expr": "(sort(bottomk(6, 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) == 0)", "legendFormat": "{{weather_icon}} {{exported_job}}", "instant": true }, { "refId": "C", - "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) == 2)", + "expr": "(sort(bottomk(6, 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) == 2)", "legendFormat": "{{weather_icon}} {{exported_job}}", "instant": true }, { "refId": "D", - "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) < 0)", + "expr": "(sort(bottomk(6, 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) < 0)", "legendFormat": "{{weather_icon}} {{exported_job}}", "instant": true } @@ -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 5836d66d..7a3c1db6 100644 --- a/services/monitoring/grafana-dashboard-overview.yaml +++ b/services/monitoring/grafana-dashboard-overview.yaml @@ -2307,25 +2307,25 @@ data: "targets": [ { "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)", + "expr": "(sort(bottomk(6, 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)", "legendFormat": "{{weather_icon}} {{exported_job}}", "instant": true }, { "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) == 0)", + "expr": "(sort(bottomk(6, 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) == 0)", "legendFormat": "{{weather_icon}} {{exported_job}}", "instant": true }, { "refId": "C", - "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) == 2)", + "expr": "(sort(bottomk(6, 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) == 2)", "legendFormat": "{{weather_icon}} {{exported_job}}", "instant": true }, { "refId": "D", - "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) < 0)", + "expr": "(sort(bottomk(6, 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) < 0)", "legendFormat": "{{weather_icon}} {{exported_job}}", "instant": true } @@ -2434,12 +2434,6 @@ data: ], "order": "asc" } - }, - { - "id": "limit", - "options": { - "limit": 6 - } } ], "links": [ @@ -2468,25 +2462,25 @@ data: "targets": [ { "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)", + "expr": "(sort(bottomk(6, 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)", "legendFormat": "{{weather_icon}} {{exported_job}}", "instant": true }, { "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) == 0)", + "expr": "(sort(bottomk(6, 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) == 0)", "legendFormat": "{{weather_icon}} {{exported_job}}", "instant": true }, { "refId": "C", - "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) == 2)", + "expr": "(sort(bottomk(6, 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) == 2)", "legendFormat": "{{weather_icon}} {{exported_job}}", "instant": true }, { "refId": "D", - "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) < 0)", + "expr": "(sort(bottomk(6, 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) < 0)", "legendFormat": "{{weather_icon}} {{exported_job}}", "instant": true } @@ -2595,12 +2589,6 @@ data: ], "order": "asc" } - }, - { - "id": "limit", - "options": { - "limit": 6 - } } ], "links": [