Files
mtusi2026lab7/infra/runbooks/queue-lag.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
918 B
Markdown

# Queue lag / time-to-ready
1. Grafana → Lab6 → Jobs and queue: `messenger_queue_oldest_job_age_seconds`, `rabbitmq_queue_messages_ready`, `messenger_worker_busy/capacity`, TTR p95.
2. If oldest age grows and `worker_busy == capacity`, the worker is saturated: inspect `worker` logs (`job claimed`, `job retry scheduled`) and `WORKER_CONCURRENCY`.
3. If queue depth grows but `worker_busy == 0`, the worker is stopped or cannot connect to the broker: `docker compose ps worker`, worker `/health/ready`, broker `rabbitmqctl list_queues`.
4. If retries grow, filter Loki `{service_name="messenger-worker"} | severity_text="error"` and trace `job.process` attempts; check `error_code`.
5. For a lost delivery, relay logs `outbox publish cycle` / `lost queued jobs reconciled` and `jobctl failed`.
6. Restore worker/broker, verify queue depth < 5 and oldest age < 5s for two scrapes, then confirm the alert resolved.