Files
2026-11-16 16:08:15 +03:00

29 lines
1.2 KiB
YAML

groups:
- name: messenger
rules:
- record: messenger:http_error_ratio:2m
expr: |
(sum(rate(http_requests_total{service_name="messenger-api",status_class="5xx"}[2m])) or vector(0))
/ clamp_min(sum(rate(http_requests_total{service_name="messenger-api"}[2m])), 0.001)
- alert: ApiHighErrorRate
expr: messenger:http_error_ratio:2m > 0.05 and sum(increase(http_requests_total{service_name="messenger-api"}[2m])) >= 20
for: 20s
labels:
severity: warning
annotations:
summary: 'API: more than 5% server errors over 2 minutes'
description: 'SLI is 5xx / all non-health requests. At least 20 requests in the window.'
runbook: 'infra/otel/README.md#api-errors'
- alert: QueueLagHigh
expr: |
max(queue_oldest_age_seconds) > 30
and max(queue_depth) > 0
and time() - max(queue_sample_timestamp_seconds) < 15
for: 15s
labels:
severity: warning
annotations:
summary: 'Oldest queued attachment waits more than 30 seconds'
description: 'Check worker capacity/busy and job errors; backlog is sampled by dispatcher.'
runbook: 'infra/otel/README.md#queue-lag'