mirror of
https://github.com/samber/awesome-prometheus-alerts.git
synced 2026-06-21 08:57:19 +08:00
Fix Redis missing master query
The previous approach fails because of the "missing data" semantics in Prometheus. If the Redis server is down, PromQL will typically return "no data" instead of 0 for a `count()`; this is by design in Prometheus. This suggestion as given by @slovdahl works around this by returning an vector with a single `0` entry in this case, making the query work as intended.
This commit is contained in:
parent
2186841f29
commit
00dd58eace
1 changed files with 1 additions and 1 deletions
|
|
@ -520,7 +520,7 @@ groups:
|
|||
severity: critical
|
||||
- name: Redis missing master
|
||||
description: Redis cluster has no node marked as master.
|
||||
query: 'count(redis_instance_info{role="master"}) == 0'
|
||||
query: 'count(redis_instance_info{role="master"}) or vector(0) < 1'
|
||||
severity: critical
|
||||
- name: Redis too many masters
|
||||
description: Redis cluster has too many nodes marked as master.
|
||||
|
|
|
|||
Loading…
Reference in a new issue