mirror of
https://github.com/samber/awesome-prometheus-alerts.git
synced 2026-06-24 18:36:59 +08:00
tune Targets Missing rules (#497)
* tune Targets Missing rules * reworked query logic * Update rules.yml --------- Co-authored-by: Samuel Berthe <dev@samuel-berthe.fr>
This commit is contained in:
parent
9998e22145
commit
e60601fdcd
2 changed files with 5 additions and 2 deletions
|
|
@ -19,8 +19,11 @@ groups:
|
||||||
severity: warning
|
severity: warning
|
||||||
- name: Prometheus target missing
|
- name: Prometheus target missing
|
||||||
description: A Prometheus target has disappeared. An exporter might be crashed.
|
description: A Prometheus target has disappeared. An exporter might be crashed.
|
||||||
query: "up == 0"
|
query: "up == 0 unless on(job) (sum by (job) (up) == 0)"
|
||||||
severity: critical
|
severity: critical
|
||||||
|
comments: |
|
||||||
|
Only fire if at least one target in the job is still up.
|
||||||
|
If all targets are down, PrometheusJobMissing or PrometheusAllTargetsMissing will fire instead.
|
||||||
- name: Prometheus all targets missing
|
- name: Prometheus all targets missing
|
||||||
description: A Prometheus job does not have living target anymore.
|
description: A Prometheus job does not have living target anymore.
|
||||||
query: "sum by (job) (up) == 0"
|
query: "sum by (job) (up) == 0"
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ groups:
|
||||||
description: "A Prometheus job has disappeared\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
|
description: "A Prometheus job has disappeared\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
|
||||||
|
|
||||||
- alert: PrometheusTargetMissing
|
- alert: PrometheusTargetMissing
|
||||||
expr: 'up == 0'
|
expr: 'up == 0 unless on(job) (sum by (job) (up) == 0)'
|
||||||
for: 0m
|
for: 0m
|
||||||
labels:
|
labels:
|
||||||
severity: critical
|
severity: critical
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue