Files
mtusi2026lab7/infra/alerts.yaml
T

21 lines
873 B
YAML

groups:
- name: messenger
interval: 5s
rules:
- alert: MessengerHighErrors
expr: sum(rate(http_requests_total{status_class="5xx",route!~"/health/.*"}[1m])) / clamp_min(sum(rate(http_requests_total{route!~"/health/.*"}[1m])),0.001) > 0.2
for: 10s
labels:
severity: warning
annotations:
summary: API error ratio exceeds 20 percent
description: Inspect postgresql.transaction spans and db_pool_waiting. Restore db and verify ready.
- alert: MessengerQueueLag
expr: max(queue{measurement="oldest_seconds"}) > 10
for: 10s
labels:
severity: warning
annotations:
summary: Oldest unfinished job is older than ten seconds
description: Inspect worker_busy, jobs_processed_total and worker logs. Restore worker and verify backlog drains.