Queue depth and age monitoring
Why it matters
A queue that is silently backing up means recipients are waiting hours for time-sensitive transactional email — password resets, order confirmations, MFA codes. Without polling queue depth and job age on a schedule, a backlog caused by an ESP outage or a misconfigured concurrency setting is only discovered when users complain. ISO 25010 reliability requires that fault conditions are observable before they become user-facing failures. Job age is the earlier signal: a large depth with young jobs is a spike; a small depth with ancient jobs is a stuck worker.
Severity rationale
High because an unmonitored queue backlog can silently delay time-critical transactional emails — MFA codes and password resets — causing user lockouts before any alert fires.
Remediation
Add a periodic health poller in your queue worker bootstrap file (e.g., src/workers/email.worker.ts or src/lib/queue/monitor.ts), running on a setInterval of no more than 5 minutes:
const counts = await queue.getJobCounts('wait', 'active', 'delayed')
const oldest = await queue.getJobs(['wait'], 0, 1, true) // oldest first
const ageMs = oldest[0] ? Date.now() - oldest[0].timestamp : 0
metrics.gauge('email_queue_depth', counts.wait + counts.delayed)
metrics.gauge('email_queue_oldest_job_age_seconds', Math.floor(ageMs / 1000))
Both depth and age are required — emitting only one of the two is not sufficient for this check to pass.
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the Operational Resilience (Email) Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- iso-25010:2011 · reliability.fault-tolerance — Reliability / Fault Tolerance — unmonitored queue depth hides backlog failures
- cwe · CWE-391 — Unchecked Error Condition — queue health not proactively polled
Taxons
History
- 2026-04-18·v1.0.0·Initial import from operational-resilience-email·automated