infra/k8s/monitoring/alerts-postgres.yaml
Finn 57b9179932
All checks were successful
/ diff-and-deploy (push) Successful in 2m25s
add postgres alerts
2025-02-04 10:29:19 -08:00

20 lines
683 B
YAML

apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
labels:
prometheus: k8s
role: alert-rules
name: postgres-operator-alerts
namespace: monitoring
spec:
groups:
- name: postgres-operator
rules:
- alert: PatroniHasNoLeader
expr: (max by (scope) (patroni_master) < 1) and (max by (scope) (patroni_standby_leader) < 1)
for: 0m
labels:
severity: critical
annotations:
summary: Patroni has no Leader (instance {{ $labels.instance }})
description: "A leader node (neither primary nor standby) cannot be found inside the cluster {{ $labels.scope }}\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"