diff --git a/instrumentation/active_job/example/active_job.rb b/instrumentation/active_job/example/active_job.rb index d7f13e7fdb..9ac36ac572 100644 --- a/instrumentation/active_job/example/active_job.rb +++ b/instrumentation/active_job/example/active_job.rb @@ -71,6 +71,18 @@ def perform end class TestJob < ::ActiveJob::Base + around_enqueue do |_job, block| + OpenTelemetry.tracer_provider.tracer('demo', '1.0').in_span('around_enqueue') do + block.call + end + end + + around_perform do |_job, block| + OpenTelemetry.tracer_provider.tracer("demo", 1.0).in_span("around_perform") do + block.call + end + end + def perform puts <<~EOS