Files
mtusi2026lab7/infra/runbooks/api-errors.md
T
Vladislav Kunetskiy 3d216fbd50 База lab7: контракт 1.7.0 и реализация lab1–lab6
Перенесены cmd/internal/config, compose.yaml, Dockerfile, скрипты, student-tests и evidence из mtusi-messenger (master, lab6). Skeleton lab7 (openapi/infrastructure 1.7.0, trust-matrix.md, security/THREAT_MODEL.md, infra/openbao, tests/security.py) сохранён; make test-security добавлен в Makefile.
2026-11-09 13:03:49 +03:00

9 lines
916 B
Markdown

# 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.