Files
mtusi2026lab6/infra/runbooks/api-errors.md
T
2026-11-05 02:09:39 +03:00

916 B

API error / availability SLI

  1. Grafana → Lab6 → API overview. Check slo:api_error_ratio:5m and the edge panel; 5xx at HAProxy is the SLI, API-side 5xx is diagnostic.
  2. Prometheus → Status → Targets: haproxy, otel-collector, rabbitmq must be UP. If HAProxy is DOWN, no edge SLI exists; inspect docker compose ps lb.
  3. HAProxy stats http://127.0.0.1:8404/stats: look for DOWN replicas and check errors. A stale X-Instance-Id is the stopped replica.
  4. If all replicas are DOWN, check /health/ready of one replica (5xx means DB/S3 dependency) and PostgreSQL logs.
  5. For a slow handler, open a Tempo trace from the error panel; DB child span (SELECT/INSERT/UPDATE/BEGIN/COMMIT) duration vs HTTP span shows whether PostgreSQL or the handler is slow. Correlate trace_id in Loki.
  6. Recover DB/S3, wait for HAProxy rise 2, then verify a 2xx through the LB and resolved alert.