monitoring(overview): derive jenkins top-6 in PromQL per panel

This commit is contained in:
Brad Stein 2026-04-13 22:38:40 -03:00
parent 99e7dababd
commit 8ac428f816
3 changed files with 26 additions and 44 deletions

View File

@ -505,6 +505,12 @@ JENKINS_BUILD_WEATHER_LAST_SUCCESS_AGE_HOURS_BY_JOB = (
JENKINS_BUILD_WEATHER_LAST_FAILURE_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})" 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 = ( JENKINS_BUILD_WEATHER_LAST_DURATION_MINUTES = (
"ariadne_jenkins_build_weather_job_last_duration_seconds / 60" "ariadne_jenkins_build_weather_job_last_duration_seconds / 60"
) )
@ -2192,12 +2198,12 @@ def build_overview():
jenkins_weather_statlist_panel( jenkins_weather_statlist_panel(
142, 142,
"Jenkins Last Success (h, newest first)", "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}, {"h": 5, "w": 4, "x": 8, "y": 32},
unit="h", unit="h",
decimals=1, decimals=1,
sort_order="asc", sort_order="asc",
limit=6, limit=None,
title_size=11, title_size=11,
value_size=11, value_size=11,
links=link_to("atlas-jobs"), links=link_to("atlas-jobs"),
@ -2212,12 +2218,12 @@ def build_overview():
jenkins_weather_statlist_panel( jenkins_weather_statlist_panel(
243, 243,
"Jenkins Last Failure (h, newest first)", "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}, {"h": 5, "w": 4, "x": 12, "y": 32},
unit="h", unit="h",
decimals=1, decimals=1,
sort_order="asc", sort_order="asc",
limit=6, limit=None,
title_size=11, title_size=11,
value_size=11, value_size=11,
links=link_to("atlas-jobs"), links=link_to("atlas-jobs"),

View File

@ -2298,25 +2298,25 @@
"targets": [ "targets": [
{ {
"refId": "A", "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}}", "legendFormat": "{{weather_icon}} {{exported_job}}",
"instant": true "instant": true
}, },
{ {
"refId": "B", "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}}", "legendFormat": "{{weather_icon}} {{exported_job}}",
"instant": true "instant": true
}, },
{ {
"refId": "C", "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}}", "legendFormat": "{{weather_icon}} {{exported_job}}",
"instant": true "instant": true
}, },
{ {
"refId": "D", "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}}", "legendFormat": "{{weather_icon}} {{exported_job}}",
"instant": true "instant": true
} }
@ -2425,12 +2425,6 @@
], ],
"order": "asc" "order": "asc"
} }
},
{
"id": "limit",
"options": {
"limit": 6
}
} }
], ],
"links": [ "links": [
@ -2459,25 +2453,25 @@
"targets": [ "targets": [
{ {
"refId": "A", "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}}", "legendFormat": "{{weather_icon}} {{exported_job}}",
"instant": true "instant": true
}, },
{ {
"refId": "B", "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}}", "legendFormat": "{{weather_icon}} {{exported_job}}",
"instant": true "instant": true
}, },
{ {
"refId": "C", "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}}", "legendFormat": "{{weather_icon}} {{exported_job}}",
"instant": true "instant": true
}, },
{ {
"refId": "D", "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}}", "legendFormat": "{{weather_icon}} {{exported_job}}",
"instant": true "instant": true
} }
@ -2586,12 +2580,6 @@
], ],
"order": "asc" "order": "asc"
} }
},
{
"id": "limit",
"options": {
"limit": 6
}
} }
], ],
"links": [ "links": [

View File

@ -2307,25 +2307,25 @@ data:
"targets": [ "targets": [
{ {
"refId": "A", "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}}", "legendFormat": "{{weather_icon}} {{exported_job}}",
"instant": true "instant": true
}, },
{ {
"refId": "B", "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}}", "legendFormat": "{{weather_icon}} {{exported_job}}",
"instant": true "instant": true
}, },
{ {
"refId": "C", "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}}", "legendFormat": "{{weather_icon}} {{exported_job}}",
"instant": true "instant": true
}, },
{ {
"refId": "D", "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}}", "legendFormat": "{{weather_icon}} {{exported_job}}",
"instant": true "instant": true
} }
@ -2434,12 +2434,6 @@ data:
], ],
"order": "asc" "order": "asc"
} }
},
{
"id": "limit",
"options": {
"limit": 6
}
} }
], ],
"links": [ "links": [
@ -2468,25 +2462,25 @@ data:
"targets": [ "targets": [
{ {
"refId": "A", "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}}", "legendFormat": "{{weather_icon}} {{exported_job}}",
"instant": true "instant": true
}, },
{ {
"refId": "B", "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}}", "legendFormat": "{{weather_icon}} {{exported_job}}",
"instant": true "instant": true
}, },
{ {
"refId": "C", "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}}", "legendFormat": "{{weather_icon}} {{exported_job}}",
"instant": true "instant": true
}, },
{ {
"refId": "D", "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}}", "legendFormat": "{{weather_icon}} {{exported_job}}",
"instant": true "instant": true
} }
@ -2595,12 +2589,6 @@ data:
], ],
"order": "asc" "order": "asc"
} }
},
{
"id": "limit",
"options": {
"limit": 6
}
} }
], ],
"links": [ "links": [