This module helps you see what's happening inside Drupal's queue system, making it easier to debug and understand background tasks. It provides a way to view and manage items in the queue, helping you identify and resolve issues with background processing.
Queue trace provides per-item execution tracing, performance metrics, payload dead-letter capture (DLQ), execution batch grouping, and retry observability for Drupal queues.
By decorating Drupal core's QueueWorkerManager, Queue Trace offers complete visibility into queue processing without requiring alterations to your existing queue workers or queue backend storage.
Features
- Non-invasive architecture: Decorates
plugin.manager.queue_workerusing standard Drupal service decoration. Does not modify core queue backends. - Per-item observability: Records status (
processing,success,failed,requeued,reprocessed_success,reprocessed_failed), execution duration in milliseconds, worker class, and throwable error traces (with file and line). - Dead-Letter Queue (DLQ) capture: Preserves JSON-encoded payloads for failed items to allow zero-data-loss inspection and replay.
-
One-click retry & re-enqueue:
- Re-enqueue failed items back into their active Drupal queue.
- Execute failed items synchronously from the UI for immediate debugging.
- Batch re-enqueue all failed items visible on the current view.
- Execution & batch grouping: Dynamically extracts batch or execution context from payload keys or entity lookups (e.g., Campaign #12, Sync Batch #45) with configurable idle windows.
- Active queues overview: Real-time dashboard of all registered workers, waiting item count, and in-flight item count.
- Zero-impact failure model: All tracing writes are isolated in
try/catchblocks; tracer issues will never interrupt core worker execution.
Requirements
- Drupal 10.3+ or Drupal 11.x
- Core Views module
Installation
Install via Composer:
composer require 'drupal/queue_trace:^1.0@alpha'Enable the module via Drush or the administrative UI:
drush en queue_traceConfiguration
Navigate to Reports > Queue Trace > Settings (/admin/reports/queue-trace/settings):
-
Trace Mode:
- Only configured queues (recommended): Only traces queues explicitly enabled in the settings table.
- All site queues: Automatically traces every registered QueueWorker across the site.
- Per-Queue Settings: Enable tracking, select payload keys for batch ID and item ID, enable entity lookup for readable labels, and define the idle window for batch grouping.
User Interface
Access the live dashboard and logs under Reports > Queue Trace (/admin/reports/queue-trace). Filter by queue name, batch label, status, or date, and trigger retries directly from the operations column.
API & Extensibility
Queue Trace provides hooks to customize execution context and item label extraction:
hook_queue_trace_extract_execution_context(string $queue_name, mixed $data): ?array hook_queue_trace_extract_item_label(string $queue_name, mixed $data): ?string
Ask your assistant about Queue Trace
Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works
Depends on
Dependencies of the latest stable release
- views Drupal core
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.
Activity
Releases
| Version | Type | Core | PHP | Release date | |
|---|---|---|---|---|---|
| 1.0.0 | Stable | 10–11 | Oct 2, 2026 | ||
| 1.0.0-alpha1 | Pre-release | 10–11 | Sep 30, 2026 |