apiVersion: 1 groups: - orgId: 1 name: messenger-slo folder: Messenger interval: 30s rules: - uid: messenger-high-error-rate title: High HTTP error rate condition: C for: 2m data: - refId: A relativeTimeRange: {from: 300, to: 0} datasourceUid: Prometheus model: expr: sum(rate(http_requests_total{status_class="5xx", route!~"/health.*"}[5m])) / sum(rate(http_requests_total{route!~"/health.*"}[5m])) instant: true refId: A - refId: C datasourceUid: "__expr__" model: type: threshold expression: A conditions: - evaluator: {type: gt, params: [0.05]} refId: C labels: severity: critical annotations: summary: "5xx ratio on business requests above 5% for 2 minutes" description: > SLI: 5xx / all business requests (excluding /health*), 5m window. SLO: error ratio < 5%. Runbook: check `db_pool_connections` (DB saturation?) and recent error-level entries in {service_name="messenger-api"} in Loki; correlate via trace_id with Tempo to find the failing dependency. - uid: messenger-growing-queue-lag title: Growing attachment queue lag condition: C for: 2m data: - refId: A relativeTimeRange: {from: 60, to: 0} datasourceUid: Prometheus model: expr: max(queue_backlog{metric="oldest_age_seconds"}) instant: true refId: A - refId: C datasourceUid: "__expr__" model: type: threshold expression: A conditions: - evaluator: {type: gt, params: [120]} refId: C labels: severity: warning annotations: summary: "Oldest pending attachment job older than 2 minutes" description: > SLI: oldest_age_seconds from queue_backlog. SLO: < 120s under normal load. Runbook: check `worker_concurrency_slots` (busy==capacity sustained => worker saturated) and whether the worker container is running (`docker compose ps worker`); check messenger-worker logs in Loki for repeated processing_failed entries (S3/DB dependency down).