Documentation
¶
Overview ¶
Package asynqx carries OpenTelemetry trace context across the asynq boundary. asynq has no message headers, so the producer wraps the task payload in an envelope holding the W3C trace context, and the worker-side middleware unwraps it, resumes the producer's trace and opens a consumer span around the handler. Payloads without an envelope (older in-flight tasks, traceless producers, scheduler ticks) pass through untouched and get a root span, so every task execution logs a trace id either way.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Middleware ¶
func Middleware() asynq.MiddlewareFunc
Middleware resumes the producer's trace from the payload envelope (when present), hands the handler the unwrapped payload, and records the task execution as a consumer span.
Types ¶
type Client ¶
Client wraps *asynq.Client so EnqueueContext stamps the caller's trace context onto the task. Wrapping rebuilds the task, which drops options embedded at NewTask time — pass options to EnqueueContext instead. The plain Enqueue promotes from the inner client untraced (it has no context to read).