groups: - name: messenger-slo rules: - alert: ApiHighErrorRate expr: sum(http_server_request_duration_seconds_count{service_name="messenger-api",http_response_status_code=~"5.."}) > 10 for: 30s labels: severity: critical slo: availability annotations: summary: "More than 10 total 5xx responses" description: "Total 5xx count: {{ $value }}" - alert: AttachmentQueueLagHigh expr: attachment_jobs_oldest_age_seconds > 60 for: 1m labels: severity: warning slo: freshness annotations: summary: "Oldest unfinished attachment job > 60s" - alert: WorkerStalled expr: | attachment_jobs_queue_depth > 0 and increase(worker_jobs_processed_total{status="done"}[10m]) == 0 for: 5m labels: severity: critical slo: freshness annotations: summary: "Queue non-empty but no jobs completed in 10m" - alert: ApiLatencyP95High expr: | histogram_quantile(0.95, sum by (le) (rate(http_server_request_duration_seconds_bucket{service_name="messenger-api"}[5m])) ) > 0.5 for: 5m labels: severity: warning slo: latency annotations: summary: "API p95 latency > 500ms"