Files
mtusi2026lab7/infra/runbooks/queue-lag.md
T
Vladislav Kunetskiy 1b6e96ccc0
Application / Go invariants and static checks (pull_request) Canceled after 0s
Application / Lab7 verified TLS and retained features (pull_request) Canceled after 0s
Skeleton contracts / contracts (pull_request) Canceled after 0s
lab7: безопасность, mTLS, OpenBao и PKI lifecycle
2026-11-10 14:39:57 +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.