Observability Runbook (Queue/Tools/Latency/Embeddings)
Last Updated: 2026-02-28
Scope: Runtime operational diagnosis for the architecture-hardening track.
Purpose
Provide a single operational view for the four critical signals required by closure:
- queue backlog/worker health
- tool access denials by reason
- turn latency breakdowns
- embedding usage and failures
This runbook is designed to let on-call diagnose first without reading source code.
Primary Data Sources
- Admin endpoint:
GET /api/admin/observability- returns queue health, denial counters, latency percentiles, embedding totals
- Health endpoints:
GET /health/readyGET /health/detailed
- Log events:
[ToolExecutor] Tool access denied[ChatFlow] Latency breakdown[ChatFlow] Embedding usage[BackgroundJob][bullmq] Enqueued/ failed/completed worker logs
Triage Playbook
1) Queue symptoms
- Symptom: queue
ok=falseordetails=worker_not_running.- Action:
- verify Redis connectivity/config (
BG_QUEUE_REDIS_URLorREDIS_URL) - restart backend worker process
- confirm
GET /api/admin/observabilityshowsworkerRunning=true
- verify Redis connectivity/config (
- Action:
- Symptom:
failed_backlog_high.- Action:
- inspect recent failed jobs in logs
- verify payload size limit (
BG_FILE_JOB_MAX_BYTES) - lower enqueue pressure until failures stabilize
- Action:
2) Tool denial spikes
- Symptom: rising
toolDenials.byReason.- Action:
allowed_protocols_mismatch: validate routed protocol against tool policyexplicit_user_selected_required: ensure UI/agent explicitly selected toolself_only_target_mismatch: inspect payload target user and caller user
- Escalation:
- if denials block normal user workflows, open policy regression incident
- Action:
3) Latency regressions
- Symptom:
turnLatency.p95TotalTurnMsjumps.- Action:
- inspect latest samples in
turnLatency.latest - isolate dominant stage (
retrievalMs,modelMs,toolMs, etc.) - correlate with deployment and traffic changes
- inspect latest samples in
- Action:
4) Embedding failures/cost pressure
- Symptom: high
embeddingFailuresInTurnor increasing provider failures.- Action:
- check embedding provider credentials/config
- verify cache-hit ratio trends
- reduce noisy embedding callers if failures are transient
- Action:
Release-Gate Evidence Requirements
For architecture-affecting PRs:
- attach latest:
npm run test:release:gatenpm run env:check-drift
- include snapshot excerpt from
GET /api/admin/observabilityproving:- queue health visible
- denial counters visible
- latency p50/p95 visible
- embedding totals visible
Escalation Notes
- P0/P1 regressions: block release immediately.
- P2 regressions:
- if diagnosis remains possible via this runbook and endpoint, classify as non-blocking hardening item
- if diagnosis is not possible, classify as release-blocking observability failure