Skip to content

Commit

Permalink
refactor: Default to Proxy Tracer in instrumentations
Browse files Browse the repository at this point in the history
While working on #677,
I ran into an issue where the base instrumentation tracer was not being automatically upgraded
after the SDK initialization was complete.

I am not sure why this was implemented this way but I figured other instrumentations would need a reference to a proxy tracer in the future.

open-telemetry/opentelemetry-ruby#671
  • Loading branch information
arielvalentin committed Oct 11, 2023
1 parent fc5a75f commit a48e87e
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ def initialize(name, version, install_blk, present_blk,
@config = {}
@installed = false
@options = options
@tracer = OpenTelemetry::Trace::Tracer.new
@tracer = OpenTelemetry.tracer_provider.tracer(name, version)
end
# rubocop:enable Metrics/ParameterLists

Expand All @@ -220,7 +220,6 @@ def install(config = {})
return false unless installable?(config)

instance_exec(@config, &@install_blk)
@tracer = OpenTelemetry.tracer_provider.tracer(name, version)
@installed = true
end

Expand Down

0 comments on commit a48e87e

Please sign in to comment.