diff --git a/adapters/faraday/test/test_helper.rb b/adapters/faraday/test/test_helper.rb index 347cc5d90..ddf5e0567 100644 --- a/adapters/faraday/test/test_helper.rb +++ b/adapters/faraday/test/test_helper.rb @@ -12,11 +12,10 @@ require 'webmock/minitest' # global opentelemetry-sdk setup: -sdk = OpenTelemetry::SDK -exporter = sdk::Trace::Export::InMemorySpanExporter.new -span_processor = sdk::Trace::Export::SimpleSpanProcessor.new(exporter) -OpenTelemetry.tracer_factory = sdk::Trace::TracerFactory.new.tap do |factory| - factory.add_span_processor(span_processor) -end +# global opentelemetry-sdk setup: +EXPORTER = OpenTelemetry::SDK::Trace::Export::InMemorySpanExporter.new +span_processor = OpenTelemetry::SDK::Trace::Export::SimpleSpanProcessor.new(EXPORTER) -EXPORTER = exporter \ No newline at end of file +OpenTelemetry::SDK.configure do |c| + c.add_span_processor span_processor +end diff --git a/adapters/sinatra/test/test_helper.rb b/adapters/sinatra/test/test_helper.rb index 80d365eb7..91208e52f 100644 --- a/adapters/sinatra/test/test_helper.rb +++ b/adapters/sinatra/test/test_helper.rb @@ -12,11 +12,9 @@ require 'rack/test' # global opentelemetry-sdk setup: -sdk = OpenTelemetry::SDK -exporter = sdk::Trace::Export::InMemorySpanExporter.new -span_processor = sdk::Trace::Export::SimpleSpanProcessor.new(exporter) -OpenTelemetry.tracer_factory = sdk::Trace::TracerFactory.new.tap do |factory| - factory.add_span_processor(span_processor) -end +EXPORTER = OpenTelemetry::SDK::Trace::Export::InMemorySpanExporter.new +span_processor = OpenTelemetry::SDK::Trace::Export::SimpleSpanProcessor.new(EXPORTER) -EXPORTER = exporter +OpenTelemetry::SDK.configure do |c| + c.add_span_processor span_processor +end