forked from mtusi2026/mtusi2026lab7
Перенесены 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.
1.0 KiB
1.0 KiB
PostgreSQL slow/unavailable
- Edge SLI first: HAProxy may return 503/504 while API replicas are removed by
/health/ready; API-side 5xx can therefore be near zero. Use the HAProxy panel andup{job="haproxy"}. docker compose ps postgres;docker compose logs --tail=100 postgres;pg_isreadyfrom a replica.- Prometheus:
messenger_db_pool_used/idle/max,messenger_db_pool_empty_acquire_total,rate(...wait_seconds); API/worker DB spans in Tempo (SELECT/INSERT/UPDATE/BEGIN/COMMIT,pool.acquire) show failures/latency. - Loki:
{service_name=~"messenger-api|messenger-worker"} | severity_text="error" | trace_id="<id>". A handler span with a long DB child span is a DB problem; a long handler without a DB child is an application problem. - If PostgreSQL was stopped, start it, wait for health, then let the pool reconnect. Worker deliveries are requeued; verify no accepted job is lost (jobs accepted/ready/failed counts).
- Confirm the alert resolved; record injection/restore and first successful request timestamps.