Understand OpenTelemetry Span Attributes and Trace Propagation
mainTrace Context Propagation
Instrumentation supports two modes for connecting dispatch and execution traces:
- Link mode (default): Each job execution is an independent trace, linked to the dispatch span via a link.
- Parent mode: The job execution becomes a child of the dispatch span, sharing the same trace.
Span Attributes
Attributes follow OTel messaging semantic conventions plus custom queue-specific fields:
| Attribute | Kind | Description |
|---|---|---|
messaging.system | Semconv | 'boringqueue' (configurable) |
messaging.operation.name | Semconv | 'publish' or 'process' |
messaging.destination.name | Semconv | Queue name |
messaging.message.id | Semconv | Job ID for single-message spans |
messaging.batch.message_count | Semconv | Number of jobs in a batch dispatch |
messaging.message.retry.count | Custom | Retry count (0-based) for a job attempt |
messaging.job.name | Custom | Job class name (e.g. SendEmailJob) |
messaging.job.status | Custom | 'completed', 'failed', or 'retrying' |
messaging.job.group_id | Custom | Queue-specific group identifier |
messaging.job.priority | Custom | Queue-specific job priority |
messaging.job.delay_ms | Custom | Delay before the job becomes available |
messaging.job.queue_time_ms | Custom | Time spent waiting in queue before processing |