diff --git a/instrumentation/active_job/lib/opentelemetry/instrumentation/active_job/handlers.rb b/instrumentation/active_job/lib/opentelemetry/instrumentation/active_job/handlers.rb index 9152a1678..215fca970 100644 --- a/instrumentation/active_job/lib/opentelemetry/instrumentation/active_job/handlers.rb +++ b/instrumentation/active_job/lib/opentelemetry/instrumentation/active_job/handlers.rb @@ -41,10 +41,12 @@ def subscribe tracer = Instrumentation.instance.tracer mapper = Mappers::Attribute.new config = ActiveJob::Instrumentation.instance.config + parent_span_provider = OpenTelemetry::Instrumentation::ActiveJob - default_handler = Handlers::Default.new(tracer, mapper, config) - enqueue_handler = Handlers::Enqueue.new(tracer, mapper, config) - perform_handler = Handlers::Perform.new(tracer, mapper, config) + # TODO, use delegation instead of inheritance + default_handler = Handlers::Default.new(tracer, parent_span_provider, mapper, config) + enqueue_handler = Handlers::Enqueue.new(tracer, parent_span_provider, mapper, config) + perform_handler = Handlers::Perform.new(tracer, parent_span_provider, mapper, config) handlers_by_pattern = { 'enqueue' => enqueue_handler,