This guide documents the single-node task queue observability additions for background jobs.
Worker jobs now return a stable envelope with schema = mimirq.task_job_result.v1.
Common fields:
job_nameokreasonelapsed_secfinished_atprogress
Scope fields are attached when available:
tenant_iddataset_iddocument_idrun_idscan_run_idsuite_idconnector_id
When a job is skipped because an idempotency lock is already held, the payload keeps ok=true and records:
reason = "locked"skipped = "locked"progress.stage = "locked"
This keeps retry/skip behavior machine-readable for the API layer and for operators.
Admin endpoint:
GET /api/v1/observability/task-queue/snapshot
Snapshot fields include:
- broker health
- queue depth
- active worker count from heartbeat registry
- heartbeat interval / TTL
recent_job_outcomes: bounded recent job results captured from workers
recent_job_outcomes is best-effort. It is intended for single-node operations debugging, not for durable audit storage.
- Redis locks still act as the idempotency guardrail for repeated submissions.
- Tenant and dataset semaphores remain the concurrency limiter for document / KG-heavy jobs.
- The snapshot is intentionally bounded and PII-safe enough for admin dashboards: it carries ids, reason codes, and progress metadata, but not raw document content.