module Sashiko::Rails::TracedJob

Include in ActiveJob classes (typically ApplicationJob) to propagate the OTel trace context across the queue boundary. Works against any ActiveJob backend without backend-specific code: the carrier rides as an extra key on the job’s serialized hash, so it survives whatever backend the job lands in.

class ApplicationJob < ActiveJob::Base include Sashiko::Rails::TracedJob end

On serialize, the current Sashiko::Context.carrier is attached. On deserialize, it’s pulled off into an ivar; an around_perform callback then attaches the context before invoking the job body. Spans emitted inside perform become children of the trace that enqueued the job.