monitoring: fix gate health status query

This commit is contained in:
jenkins 2026-05-16 12:31:19 -03:00
parent a739f14a86
commit 7bb2b90a13
3 changed files with 15 additions and 6 deletions

View File

@ -3601,11 +3601,20 @@ def build_jobs_dashboard():
f'or on(suite) ((0 * ({runs_by_suite_24h})) - 1))'
)
non_failure = PLATFORM_TEST_NON_FAILURE_STATUS
current_gate_ok_vector = (
f'(({{{checks_selector},result=~"{non_failure}"}} > bool 0) '
f'or ({{{checks_selector},status=~"{non_failure}"}} > bool 0))'
)
current_gate_seen_vector = f'({{{checks_selector}}} > bool 0)'
current_gate_ok_checks = (
f"sum by (suite) (max by (suite, check) ({current_gate_ok_vector}))"
)
current_gate_seen_checks = (
f"sum by (suite) (max by (suite, check) ({current_gate_seen_vector}))"
)
current_gate_health_by_suite = (
f'(100 * sum by (suite) (max by (suite, check) ((({{{checks_selector},result=~"{non_failure}"}} > bool 0) '
f'or ({{{checks_selector},status=~"{non_failure}"}} > bool 0))) '
f'/ clamp_min(sum by (suite) (max by (suite, check) (({{{checks_selector}}} > bool 0))), 1)) '
f'or on(suite) ({selected_suite_zero}))'
f"((100 * ({current_gate_ok_checks}) / clamp_min(({current_gate_seen_checks}), 1)) "
f"or on(suite) ({selected_suite_zero}))"
)
success_history_runs = f'sum by (suite) (increase(platform_quality_gate_runs_total{{{runs_selector}}}[7d]))'
success_history_by_suite = (

View File

@ -449,7 +449,7 @@
},
"targets": [
{
"expr": "sort((100 * sum by (suite) (max by (suite, check) ((({__name__=~\".*_quality_gate_checks_total\",suite=~\"${suite:regex}\",exported_job=\"platform-quality-ci\",result=~\"ok|passed|success|not_applicable|skipped|na|n/a\"} > bool 0) or ({__name__=~\".*_quality_gate_checks_total\",suite=~\"${suite:regex}\",exported_job=\"platform-quality-ci\",status=~\"ok|passed|success|not_applicable|skipped|na|n/a\"} > bool 0))) / clamp_min(sum by (suite) (max by (suite, check) (({__name__=~\".*_quality_gate_checks_total\",suite=~\"${suite:regex}\",exported_job=\"platform-quality-ci\"} > bool 0))), 1)) or on(suite) ((0 * (count by (suite) (platform_quality_gate_build_info{suite=~\"${suite:regex}\",branch!=\"\",branch=~\"${branch:regex}\",exported_job=\"platform-quality-ci\"}) >= bool 0)))))",
"expr": "sort(((100 * (sum by (suite) (max by (suite, check) ((({__name__=~\".*_quality_gate_checks_total\",suite=~\"${suite:regex}\",exported_job=\"platform-quality-ci\",result=~\"ok|passed|success|not_applicable|skipped|na|n/a\"} > bool 0) or ({__name__=~\".*_quality_gate_checks_total\",suite=~\"${suite:regex}\",exported_job=\"platform-quality-ci\",status=~\"ok|passed|success|not_applicable|skipped|na|n/a\"} > bool 0))))) / clamp_min((sum by (suite) (max by (suite, check) (({__name__=~\".*_quality_gate_checks_total\",suite=~\"${suite:regex}\",exported_job=\"platform-quality-ci\"} > bool 0)))), 1)) or on(suite) ((0 * (count by (suite) (platform_quality_gate_build_info{suite=~\"${suite:regex}\",branch!=\"\",branch=~\"${branch:regex}\",exported_job=\"platform-quality-ci\"}) >= bool 0)))))",
"refId": "A",
"legendFormat": "{{suite}}",
"instant": true

View File

@ -458,7 +458,7 @@ data:
},
"targets": [
{
"expr": "sort((100 * sum by (suite) (max by (suite, check) ((({__name__=~\".*_quality_gate_checks_total\",suite=~\"${suite:regex}\",exported_job=\"platform-quality-ci\",result=~\"ok|passed|success|not_applicable|skipped|na|n/a\"} > bool 0) or ({__name__=~\".*_quality_gate_checks_total\",suite=~\"${suite:regex}\",exported_job=\"platform-quality-ci\",status=~\"ok|passed|success|not_applicable|skipped|na|n/a\"} > bool 0))) / clamp_min(sum by (suite) (max by (suite, check) (({__name__=~\".*_quality_gate_checks_total\",suite=~\"${suite:regex}\",exported_job=\"platform-quality-ci\"} > bool 0))), 1)) or on(suite) ((0 * (count by (suite) (platform_quality_gate_build_info{suite=~\"${suite:regex}\",branch!=\"\",branch=~\"${branch:regex}\",exported_job=\"platform-quality-ci\"}) >= bool 0)))))",
"expr": "sort(((100 * (sum by (suite) (max by (suite, check) ((({__name__=~\".*_quality_gate_checks_total\",suite=~\"${suite:regex}\",exported_job=\"platform-quality-ci\",result=~\"ok|passed|success|not_applicable|skipped|na|n/a\"} > bool 0) or ({__name__=~\".*_quality_gate_checks_total\",suite=~\"${suite:regex}\",exported_job=\"platform-quality-ci\",status=~\"ok|passed|success|not_applicable|skipped|na|n/a\"} > bool 0))))) / clamp_min((sum by (suite) (max by (suite, check) (({__name__=~\".*_quality_gate_checks_total\",suite=~\"${suite:regex}\",exported_job=\"platform-quality-ci\"} > bool 0)))), 1)) or on(suite) ((0 * (count by (suite) (platform_quality_gate_build_info{suite=~\"${suite:regex}\",branch!=\"\",branch=~\"${branch:regex}\",exported_job=\"platform-quality-ci\"}) >= bool 0)))))",
"refId": "A",
"legendFormat": "{{suite}}",
"instant": true