Skip to content

Commit

Permalink
fix: add examples of in-line instrumentation
Browse files Browse the repository at this point in the history
  • Loading branch information
arielvalentin committed Oct 11, 2023
1 parent 6f51c7c commit 58dc464
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions instrumentation/active_job/example/active_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 58dc464

Please sign in to comment.