Alerting on 2 consecutive failures - daily Jenkins job - default_jenkins_builds_last_build_result

144 views
Skip to first unread message

Evelyn Pereira Souza

unread,
Aug 4, 2022, 8:02:17 AM8/4/22
to promethe...@googlegroups.com
Hi

We have an automatic Jenkins job that runs early every morning. If the
job is failed, i.e. red, it is not a big problem.

But if it is red 2 times in a row, an alert has to be triggered and a
human has to look at it.

Here what I have done:

---
XXX-Job-Status (1 active)
name: XXX-Job-Status
expr: default_jenkins_builds_last_build_result{jenkins_job=~".+zedf"} != 1
for: 1d1h
labels:
channel: mail
severity: critical
annotations:
description: The Jenkins Job (cron schedule) zedf failed twice in a row
---

Doesn't work, the alert is always in pending state, even though it
failed about 8 times in a row.

The metric is updated only once a day (in the morning).

kind regards
Evelyn
OpenPGP_0x61776FA8E38403FB.asc
OpenPGP_signature
Reply all
Reply to author
Forward
0 new messages