fix: update Redis alert rules for improved clarity and severity levels

Signed-off-by: zhenyus <zhenyus@mathmast.com>
This commit is contained in:
zhenyus 2025-03-08 15:12:39 +08:00
parent 5806157ade
commit d88673daa2

View File

@ -1110,35 +1110,15 @@ metrics:
## summary: Redis&reg; instance {{ "{{ $instance }}" }} has evicted keys ## summary: Redis&reg; instance {{ "{{ $instance }}" }} has evicted keys
## description: Redis&reg; instance {{ "{{ $instance }}" }} has evicted {{ "{{ $value }}" }} keys in the last 5 minutes. ## description: Redis&reg; instance {{ "{{ $instance }}" }} has evicted {{ "{{ $value }}" }} keys in the last 5 minutes.
## ##
rules: rules:
- alert: RedisDown - alert: RedisDown
expr: redis_up{service="{{ template "common.names.fullname" . }}-metrics"} == 0 expr: redis_up == 0{service="{{ template "common.names.fullname" . }}-metrics"} == 0
for: 2m for: 0m
labels: labels:
severity: error severity: critical
annotations: annotations:
summary: Redis&reg; instance {{ "{{ $instance }}" }} down summary: Redis down (instance {{ $labels.instance }})
description: Redis&reg; instance {{ "{{ $instance }}" }} is down. description: "Redis instance is down\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
- alert: RedisMemoryHigh
expr: >
redis_memory_used_bytes{service="{{ template "common.names.fullname" . }}-metrics"} * 100
/
redis_memory_max_bytes{service="{{ template "common.names.fullname" . }}-metrics"}
> 90
for: 2m
labels:
severity: error
annotations:
summary: Redis&reg; instance {{ "{{ $instance }}" }} is using too much memory
description: Redis&reg; instance {{ "{{ $instance }}" }} is using {{ "{{ $value }}" }}% of its available memory.
- alert: RedisKeyEviction
expr: increase(redis_evicted_keys_total{service="{{ template "common.names.fullname" . }}-metrics"}[5m]) > 0
for: 1s
labels:
severity: error
annotations:
summary: Redis&reg; instance {{ "{{ $instance }}" }} has evicted keys
description: Redis&reg; instance {{ "{{ $instance }}" }} has evicted {{ "{{ $value }}" }} keys in the last 5 minutes.
## @param metrics.priorityClassName Metrics exporter pod priorityClassName ## @param metrics.priorityClassName Metrics exporter pod priorityClassName
## ##
priorityClassName: "" priorityClassName: ""