feat: add PrometheusRule alerts for all services
28 alert rules across 9 PrometheusRule files covering infrastructure
(Longhorn, cert-manager), data (PostgreSQL, OpenBao, OpenSearch),
storage (SeaweedFS), devtools (Gitea), identity (Hydra, Kratos),
media (LiveKit), and mesh (Linkerd golden signals for all services).
Severity routing: critical alerts fire to Matrix + email, warnings
to Matrix only (AlertManager config updated in separate commit).
2026-03-24 12:20:55 +00:00
|
|
|
apiVersion: monitoring.coreos.com/v1
|
|
|
|
|
kind: PrometheusRule
|
|
|
|
|
metadata:
|
|
|
|
|
name: postgres-alerts
|
|
|
|
|
namespace: data
|
|
|
|
|
labels:
|
|
|
|
|
role: alert-rules
|
|
|
|
|
spec:
|
|
|
|
|
groups:
|
|
|
|
|
- name: postgres
|
|
|
|
|
rules:
|
|
|
|
|
- alert: PostgresDown
|
|
|
|
|
expr: cnpg_collector_up == 0
|
|
|
|
|
for: 2m
|
|
|
|
|
labels:
|
|
|
|
|
severity: critical
|
|
|
|
|
annotations:
|
|
|
|
|
summary: "PostgreSQL instance is down"
|
|
|
|
|
description: "CNPG collector reports {{ $labels.namespace }}/{{ $labels.pod }} is down."
|
|
|
|
|
|
|
|
|
|
- alert: PostgresDatabaseSizeLarge
|
|
|
|
|
expr: cnpg_pg_database_size_bytes > 7e9
|
|
|
|
|
for: 5m
|
|
|
|
|
labels:
|
|
|
|
|
severity: warning
|
|
|
|
|
annotations:
|
|
|
|
|
summary: "PostgreSQL database size is large"
|
|
|
|
|
description: "Database {{ $labels.datname }} is {{ $value | humanize1024 }} (PVC limit 10Gi)"
|
|
|
|
|
|
|
|
|
|
- alert: PostgresHighConnections
|
2026-03-25 18:01:15 +00:00
|
|
|
expr: sum by (pod) (cnpg_backends_total) > 80
|
feat: add PrometheusRule alerts for all services
28 alert rules across 9 PrometheusRule files covering infrastructure
(Longhorn, cert-manager), data (PostgreSQL, OpenBao, OpenSearch),
storage (SeaweedFS), devtools (Gitea), identity (Hydra, Kratos),
media (LiveKit), and mesh (Linkerd golden signals for all services).
Severity routing: critical alerts fire to Matrix + email, warnings
to Matrix only (AlertManager config updated in separate commit).
2026-03-24 12:20:55 +00:00
|
|
|
for: 5m
|
|
|
|
|
labels:
|
|
|
|
|
severity: warning
|
|
|
|
|
annotations:
|
|
|
|
|
summary: "PostgreSQL connection count is high"
|
|
|
|
|
description: "Pod {{ $labels.pod }} has {{ $value }} active connections."
|