diff --git a/instrumentation/base/lib/opentelemetry/instrumentation/base.rb b/instrumentation/base/lib/opentelemetry/instrumentation/base.rb index d944d1a6c..ccbc521fb 100644 --- a/instrumentation/base/lib/opentelemetry/instrumentation/base.rb +++ b/instrumentation/base/lib/opentelemetry/instrumentation/base.rb @@ -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 @@ -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