diff --git a/api/lib/opentelemetry.rb b/api/lib/opentelemetry.rb index e4744f638..a7daa6734 100644 --- a/api/lib/opentelemetry.rb +++ b/api/lib/opentelemetry.rb @@ -24,7 +24,7 @@ module OpenTelemetry @mutex = Mutex.new @tracer_provider = Internal::ProxyTracerProvider.new - attr_writer :propagation, :baggage, :logger, :error_handler + attr_writer :propagation, :logger, :error_handler # @return [Object, Logger] configured Logger or a default STDOUT Logger. def logger @@ -65,13 +65,6 @@ def tracer_provider @mutex.synchronize { @tracer_provider } end - # @return [Object, Baggage::NoopManager] registered - # baggage manager or a default no-op implementation of the - # manager. - def baggage - @baggage ||= Baggage::NoopManager.new - end - # @return [Context::Propagation::Propagator] a propagator instance def propagation @propagation ||= Context::Propagation::NoopTextMapPropagator.new diff --git a/api/lib/opentelemetry/baggage.rb b/api/lib/opentelemetry/baggage.rb index 8396cd27f..10cfc483b 100644 --- a/api/lib/opentelemetry/baggage.rb +++ b/api/lib/opentelemetry/baggage.rb @@ -7,13 +7,103 @@ require 'opentelemetry/baggage/propagation' require 'opentelemetry/baggage/builder' require 'opentelemetry/baggage/entry' -require 'opentelemetry/baggage/manager' -require 'opentelemetry/baggage/noop_builder' -require 'opentelemetry/baggage/noop_manager' module OpenTelemetry # The Baggage module provides functionality to record and propagate # baggage in a distributed trace module Baggage + extend self + + BAGGAGE_KEY = OpenTelemetry::Baggage::Propagation::ContextKeys.baggage_key + EMPTY_BAGGAGE = {}.freeze + private_constant(:BAGGAGE_KEY, :EMPTY_BAGGAGE) + + # Used to chain modifications to baggage. The result is a + # context with an updated baggage. If only a single + # modification is being made to baggage, use the other + # methods on +Baggage+, if multiple modifications are being made, use + # this one. + # + # @param [optional Context] context The context to update with with new + # modified baggage. Defaults to +Context.current+ + # @return [Context] + def build(context: Context.current) + builder = Builder.new(baggage_for(context).dup) + yield builder + context.set_value(BAGGAGE_KEY, builder.entries) + end + + # Returns a new context with empty baggage + # + # @param [optional Context] context Context to clear baggage from. Defaults + # to +Context.current+ + # @return [Context] + def clear(context: Context.current) + context.set_value(BAGGAGE_KEY, EMPTY_BAGGAGE) + end + + # Returns the corresponding baggage.entry (or nil) for key + # + # @param [String] key The lookup key + # @param [optional Context] context The context from which to retrieve + # the key. + # Defaults to +Context.current+ + # @return [String] + def value(key, context: Context.current) + baggage_for(context)[key]&.value + end + + # Returns the baggage + # + # @param [optional Context] context The context from which to retrieve + # the baggage. + # Defaults to +Context.current+ + # @return [Hash] + def values(context: Context.current) + baggage_for(context).transform_values(&:value) + end + + # @api private + def raw_entries(context: Context.current) + baggage_for(context).dup.freeze + end + + # Returns a new context with new key-value pair + # + # @param [String] key The key to store this value under + # @param [String] value String value to be stored under key + # @param [optional String] metadata This is here to store properties + # received from other W3C Baggage impelmentations but is not exposed in + # OpenTelemetry. This is condsidered private API and not for use by + # end-users. + # @param [optional Context] context The context to update with new + # value. Defaults to +Context.current+ + # @return [Context] + def set_value(key, value, metadata: nil, context: Context.current) + new_baggage = baggage_for(context).dup + new_baggage[key] = Entry.new(value, metadata) + context.set_value(BAGGAGE_KEY, new_baggage) + end + + # Returns a new context with value at key removed + # + # @param [String] key The key to remove + # @param [optional Context] context The context to remove baggage + # from. Defaults to +Context.current+ + # @return [Context] + def remove_value(key, context: Context.current) + baggage = baggage_for(context) + return context unless baggage.key?(key) + + new_baggage = baggage.dup + new_baggage.delete(key) + context.set_value(BAGGAGE_KEY, new_baggage) + end + + private + + def baggage_for(context) + context.value(BAGGAGE_KEY) || EMPTY_BAGGAGE + end end end diff --git a/api/lib/opentelemetry/baggage/manager.rb b/api/lib/opentelemetry/baggage/manager.rb deleted file mode 100644 index 16888ebe4..000000000 --- a/api/lib/opentelemetry/baggage/manager.rb +++ /dev/null @@ -1,104 +0,0 @@ -# frozen_string_literal: true - -# Copyright The OpenTelemetry Authors -# -# SPDX-License-Identifier: Apache-2.0 - -module OpenTelemetry - module Baggage - # Operational Baggage Manager implementation - class Manager - BAGGAGE_KEY = OpenTelemetry::Baggage::Propagation::ContextKeys.baggage_key - EMPTY_BAGGAGE = {}.freeze - private_constant(:BAGGAGE_KEY, :EMPTY_BAGGAGE) - - # Used to chain modifications to baggage. The result is a - # context with an updated baggage. If only a single - # modification is being made to baggage, use the other - # methods on +Manager+, if multiple modifications are being made, use - # this one. - # - # @param [optional Context] context The context to update with with new - # modified baggage. Defaults to +Context.current+ - # @return [Context] - def build(context: Context.current) - builder = Builder.new(baggage_for(context).dup) - yield builder - context.set_value(BAGGAGE_KEY, builder.entries) - end - - # Returns a new context with empty baggage - # - # @param [optional Context] context Context to clear baggage from. Defaults - # to +Context.current+ - # @return [Context] - def clear(context: Context.current) - context.set_value(BAGGAGE_KEY, EMPTY_BAGGAGE) - end - - # Returns the corresponding baggage.entry (or nil) for key - # - # @param [String] key The lookup key - # @param [optional Context] context The context from which to retrieve - # the key. - # Defaults to +Context.current+ - # @return [String] - def value(key, context: Context.current) - baggage_for(context)[key]&.value - end - - # Returns the baggage - # - # @param [optional Context] context The context from which to retrieve - # the baggage. - # Defaults to +Context.current+ - # @return [Hash] - def values(context: Context.current) - baggage_for(context).transform_values(&:value) - end - - # @api private - def raw_entries(context: Context.current) - baggage_for(context).dup.freeze - end - - # Returns a new context with new key-value pair - # - # @param [String] key The key to store this value under - # @param [String] value String value to be stored under key - # @param [optional String] metadata This is here to store properties - # received from other W3C Baggage impelmentations but is not exposed in - # OpenTelemetry. This is condsidered private API and not for use by - # end-users. - # @param [optional Context] context The context to update with new - # value. Defaults to +Context.current+ - # @return [Context] - def set_value(key, value, metadata: nil, context: Context.current) - new_baggage = baggage_for(context).dup - new_baggage[key] = Entry.new(value, metadata) - context.set_value(BAGGAGE_KEY, new_baggage) - end - - # Returns a new context with value at key removed - # - # @param [String] key The key to remove - # @param [optional Context] context The context to remove baggage - # from. Defaults to +Context.current+ - # @return [Context] - def remove_value(key, context: Context.current) - baggage = baggage_for(context) - return context unless baggage.key?(key) - - new_baggage = baggage.dup - new_baggage.delete(key) - context.set_value(BAGGAGE_KEY, new_baggage) - end - - private - - def baggage_for(context) - context.value(BAGGAGE_KEY) || EMPTY_BAGGAGE - end - end - end -end diff --git a/api/lib/opentelemetry/baggage/noop_builder.rb b/api/lib/opentelemetry/baggage/noop_builder.rb deleted file mode 100644 index f74667198..000000000 --- a/api/lib/opentelemetry/baggage/noop_builder.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -# Copyright The OpenTelemetry Authors -# -# SPDX-License-Identifier: Apache-2.0 - -module OpenTelemetry - module Baggage - # No op implementation of Baggage::Builder - class NoopBuilder - def set_value(key, value, metadata: nil); end - - def remove_value(key); end - - def clear; end - end - end -end diff --git a/api/lib/opentelemetry/baggage/noop_manager.rb b/api/lib/opentelemetry/baggage/noop_manager.rb deleted file mode 100644 index 59e54e96d..000000000 --- a/api/lib/opentelemetry/baggage/noop_manager.rb +++ /dev/null @@ -1,45 +0,0 @@ -# frozen_string_literal: true - -# Copyright The OpenTelemetry Authors -# -# SPDX-License-Identifier: Apache-2.0 - -module OpenTelemetry - module Baggage - # No op implementation of Baggage::Manager - class NoopManager - NOOP_BUILDER = NoopBuilder.new - EMPTY_HASH = {}.freeze - private_constant(:NOOP_BUILDER, :EMPTY_HASH) - - def build(context: Context.current) - yield NOOP_BUILDER - context - end - - def set_value(key, value, metadata: nil, context: Context.current) - context - end - - def value(key, context: Context.current) - nil - end - - def values(context: Context.current) - EMPTY_HASH - end - - def raw_entries(context: Context.current) - EMPTY_HASH - end - - def remove_value(key, context: Context.current) - context - end - - def clear(context: Context.current) - context - end - end - end -end diff --git a/api/lib/opentelemetry/baggage/propagation/text_map_propagator.rb b/api/lib/opentelemetry/baggage/propagation/text_map_propagator.rb index 84c2f77d9..c2c66aa47 100644 --- a/api/lib/opentelemetry/baggage/propagation/text_map_propagator.rb +++ b/api/lib/opentelemetry/baggage/propagation/text_map_propagator.rb @@ -29,7 +29,7 @@ class TextMapPropagator # will be used to write context into the carrier, otherwise the default # text map setter will be used. def inject(carrier, context: Context.current, setter: Context::Propagation.text_map_setter) - baggage = OpenTelemetry.baggage.raw_entries(context: context) + baggage = OpenTelemetry::Baggage.raw_entries(context: context) return if baggage.nil? || baggage.empty? @@ -55,7 +55,7 @@ def extract(carrier, context: Context.current, getter: Context::Propagation.text entries = header.gsub(/\s/, '').split(',') - OpenTelemetry.baggage.build(context: context) do |builder| + OpenTelemetry::Baggage.build(context: context) do |builder| entries.each do |entry| # Note metadata is currently unused in OpenTelemetry, but is part # the W3C spec where it's referred to as properties. We preserve diff --git a/api/test/opentelemetry/baggage/propagation/text_map_propagator_test.rb b/api/test/opentelemetry/baggage/propagation/text_map_propagator_test.rb index d725d53e1..68fc92007 100644 --- a/api/test/opentelemetry/baggage/propagation/text_map_propagator_test.rb +++ b/api/test/opentelemetry/baggage/propagation/text_map_propagator_test.rb @@ -17,15 +17,6 @@ OpenTelemetry::Baggage::Propagation::ContextKeys.baggage_key end - before do - @original_baggage_mgr = OpenTelemetry.baggage - OpenTelemetry.baggage = OpenTelemetry::Baggage::Manager.new - end - - after do - OpenTelemetry.baggage = @original_baggage_mgr - end - describe '#extract' do describe 'valid headers' do it 'extracts key-value pairs' do @@ -60,7 +51,7 @@ describe '#inject' do it 'injects baggage' do - context = OpenTelemetry.baggage.build(context: OpenTelemetry::Context.empty) do |b| + context = OpenTelemetry::Baggage.build(context: OpenTelemetry::Context.empty) do |b| b.set_value('key1', 'val1') b.set_value('key2', 'val2') end @@ -72,7 +63,7 @@ end it 'injects numeric baggage' do - context = OpenTelemetry.baggage.build(context: OpenTelemetry::Context.empty) do |b| + context = OpenTelemetry::Baggage.build(context: OpenTelemetry::Context.empty) do |b| b.set_value('key1', 1) b.set_value('key2', 3.14) end @@ -84,7 +75,7 @@ end it 'injects boolean baggage' do - context = OpenTelemetry.baggage.build(context: OpenTelemetry::Context.empty) do |b| + context = OpenTelemetry::Baggage.build(context: OpenTelemetry::Context.empty) do |b| b.set_value('key1', true) b.set_value('key2', false) end @@ -102,7 +93,7 @@ end it 'injects properties' do - context = OpenTelemetry.baggage.build(context: OpenTelemetry::Context.empty) do |b| + context = OpenTelemetry::Baggage.build(context: OpenTelemetry::Context.empty) do |b| b.set_value('key1', 'val1') b.set_value('key2', 'val2', metadata: 'prop1=propval1;prop2=propval2') end @@ -113,7 +104,7 @@ end it 'enforces max of 180 name-value pairs' do - context = OpenTelemetry.baggage.build(context: OpenTelemetry::Context.empty) do |b| + context = OpenTelemetry::Baggage.build(context: OpenTelemetry::Context.empty) do |b| (0..180).each do |i| b.set_value("k#{i}", "v#{i}") end @@ -124,7 +115,7 @@ result = carrier[header_key] # expect keys indexed from 0 to 180 to be in baggage, but only 0 to 179 in the result - _(OpenTelemetry.baggage.value('k180', context: context)).wont_be_nil + _(OpenTelemetry::Baggage.value('k180', context: context)).wont_be_nil (0...180).each do |i| _(result).must_include("k#{i}") end @@ -132,7 +123,7 @@ end it 'enforces max entry length of 4096' do - context = OpenTelemetry.baggage.build(context: OpenTelemetry::Context.empty) do |b| + context = OpenTelemetry::Baggage.build(context: OpenTelemetry::Context.empty) do |b| b.set_value('key1', 'x' * 4092) b.set_value('key2', 'val2') end @@ -151,7 +142,7 @@ keys = (0..81).map { |i| "k#{i.to_s.rjust(48, '0')}" } values = (0..81).map { |i| "v#{i.to_s.rjust(48, '0')}" } - context = OpenTelemetry.baggage.build(context: OpenTelemetry::Context.empty) do |b| + context = OpenTelemetry::Baggage.build(context: OpenTelemetry::Context.empty) do |b| keys.zip(values).each { |k, v| b.set_value(k, v) } end @@ -167,7 +158,7 @@ end def assert_value(context, key, value, metadata = nil) - entry = OpenTelemetry.baggage.raw_entries(context: context)[key] + entry = OpenTelemetry::Baggage.raw_entries(context: context)[key] _(entry).wont_be_nil _(entry.value).must_equal(value) _(entry.metadata).must_equal(metadata) diff --git a/api/test/opentelemetry/baggage/manager_test.rb b/api/test/opentelemetry/baggage_test.rb similarity index 98% rename from api/test/opentelemetry/baggage/manager_test.rb rename to api/test/opentelemetry/baggage_test.rb index 19d04024a..d61b971a1 100644 --- a/api/test/opentelemetry/baggage/manager_test.rb +++ b/api/test/opentelemetry/baggage_test.rb @@ -6,9 +6,9 @@ require 'test_helper' -describe OpenTelemetry::Baggage::Manager do +describe OpenTelemetry::Baggage do Context = OpenTelemetry::Context - let(:manager) { OpenTelemetry::Baggage::Manager.new } + let(:manager) { OpenTelemetry::Baggage } after do Context.clear diff --git a/api/test/opentelemetry_test.rb b/api/test/opentelemetry_test.rb index 9628dd519..2bd8513ee 100644 --- a/api/test/opentelemetry_test.rb +++ b/api/test/opentelemetry_test.rb @@ -127,34 +127,6 @@ def error(message) end end - describe '.baggage' do - before do - @default_baggage = OpenTelemetry.baggage - end - - after do - # Ensure we don't leak custom baggage to other tests - OpenTelemetry.baggage = @default_baggage - end - - it 'returns Baggage::NoopManager by default' do - manager = OpenTelemetry.baggage - _(manager).must_be_instance_of(OpenTelemetry::Baggage::NoopManager) - end - - it 'returns the same instance when accessed multiple times' do - _(OpenTelemetry.baggage).must_equal( - OpenTelemetry.baggage - ) - end - - it 'returns user specified baggage' do - custom_manager = 'a custom baggage' - OpenTelemetry.baggage = custom_manager - _(OpenTelemetry.baggage).must_equal(custom_manager) - end - end - describe '.propagation' do it 'returns instance of Context::Propagation::NoopTextMapPropagator by default' do _(OpenTelemetry.propagation).must_be_instance_of( diff --git a/propagator/jaeger/lib/opentelemetry/propagator/jaeger/text_map_propagator.rb b/propagator/jaeger/lib/opentelemetry/propagator/jaeger/text_map_propagator.rb index 2910fd71e..3dd285ce1 100644 --- a/propagator/jaeger/lib/opentelemetry/propagator/jaeger/text_map_propagator.rb +++ b/propagator/jaeger/lib/opentelemetry/propagator/jaeger/text_map_propagator.rb @@ -72,7 +72,7 @@ def inject(carrier, context: Context.current, setter: Context::Propagation.text_ span_context.hex_trace_id, span_context.hex_span_id, '0', flags ].join(':') setter.set(carrier, IDENTITY_KEY, trace_span_identity_value) - OpenTelemetry.baggage.values(context: context).each do |key, value| + OpenTelemetry::Baggage.values(context: context).each do |key, value| baggage_key = 'uberctx-' + key encoded_value = CGI.escape(value) setter.set(carrier, baggage_key, encoded_value) @@ -103,7 +103,7 @@ def build_span(match, sampling_flags) def context_with_extracted_baggage(carrier, context, getter) baggage_key_prefix = 'uberctx-' - OpenTelemetry.baggage.build(context: context) do |b| + OpenTelemetry::Baggage.build(context: context) do |b| getter.keys(carrier).each do |carrier_key| baggage_key = carrier_key.start_with?(baggage_key_prefix) && carrier_key[baggage_key_prefix.length..-1] next unless baggage_key diff --git a/propagator/jaeger/test/text_map_propagator_test.rb b/propagator/jaeger/test/text_map_propagator_test.rb index 39a9dd553..1c11838e1 100644 --- a/propagator/jaeger/test/text_map_propagator_test.rb +++ b/propagator/jaeger/test/text_map_propagator_test.rb @@ -106,8 +106,8 @@ def extracted_context_must_equal_parent_context(header) } context = propagator.extract(carrier, context: parent_context) - _(OpenTelemetry.baggage.value('key1', context: context)).must_equal('value1') - _(OpenTelemetry.baggage.value('key2', context: context)).must_equal('value2') + _(OpenTelemetry::Baggage.value('key1', context: context)).must_equal('value1') + _(OpenTelemetry::Baggage.value('key2', context: context)).must_equal('value2') end it 'extracts URL-encoded baggage entries' do @@ -118,7 +118,7 @@ def extracted_context_must_equal_parent_context(header) } context = propagator.extract(carrier, context: parent_context) - _(OpenTelemetry.baggage.value('key1', context: context)).must_equal('value 1 / blah') + _(OpenTelemetry::Baggage.value('key1', context: context)).must_equal('value 1 / blah') end it 'extracts baggage with different keys' do @@ -136,8 +136,8 @@ def extracted_context_must_equal_parent_context(header) ) span_context = OpenTelemetry::Trace.current_span(context).context _(span_context.hex_trace_id).must_equal('80f198ee56343ba864fe8b2a57d3eff7') - _(OpenTelemetry.baggage.value('key-1', context: context)).must_equal('value1') - _(OpenTelemetry.baggage.value('key-2', context: context)).must_equal('value2') + _(OpenTelemetry::Baggage.value('key-1', context: context)).must_equal('value1') + _(OpenTelemetry::Baggage.value('key-2', context: context)).must_equal('value2') end it 'handles trace ids and span ids that are too long' do @@ -232,7 +232,7 @@ def create_context(trace_id:, trace_id: '80f198ee56343ba864fe8b2a57d3eff7', span_id: 'e457b5a2e4d86bd1' ) - context = OpenTelemetry.baggage.build(context: context) do |baggage| + context = OpenTelemetry::Baggage.build(context: context) do |baggage| baggage.set_value('key1', 'value1') baggage.set_value('key2', 'value2') end @@ -247,7 +247,7 @@ def create_context(trace_id:, trace_id: '80f198ee56343ba864fe8b2a57d3eff7', span_id: 'e457b5a2e4d86bd1' ) - context = OpenTelemetry.baggage.build(context: context) do |baggage| + context = OpenTelemetry::Baggage.build(context: context) do |baggage| baggage.set_value('key1', 'value 1 / blah') end carrier = {} @@ -268,7 +268,7 @@ def rack_env_setter.set(carrier, key, value) span_id: 'e457b5a2e4d86bd1', trace_flags: OpenTelemetry::Trace::TraceFlags::SAMPLED ) - context = OpenTelemetry.baggage.build(context: context) do |baggage| + context = OpenTelemetry::Baggage.build(context: context) do |baggage| baggage.set_value('key-1', 'value1') baggage.set_value('key-2', 'value2') end diff --git a/propagator/ottrace/lib/opentelemetry/propagator/ottrace/text_map_propagator.rb b/propagator/ottrace/lib/opentelemetry/propagator/ottrace/text_map_propagator.rb index ad4682d32..a1fe02cf3 100644 --- a/propagator/ottrace/lib/opentelemetry/propagator/ottrace/text_map_propagator.rb +++ b/propagator/ottrace/lib/opentelemetry/propagator/ottrace/text_map_propagator.rb @@ -118,7 +118,7 @@ def set_baggage(carrier:, context:, getter:) end def baggage - OpenTelemetry.baggage + OpenTelemetry::Baggage end def inject_span_context(span_context:, carrier:, setter:) diff --git a/propagator/ottrace/test/opentelemetry/propagator/ottrace/text_map_propagator_test.rb b/propagator/ottrace/test/opentelemetry/propagator/ottrace/text_map_propagator_test.rb index a957a3879..465a54b9c 100644 --- a/propagator/ottrace/test/opentelemetry/propagator/ottrace/text_map_propagator_test.rb +++ b/propagator/ottrace/test/opentelemetry/propagator/ottrace/text_map_propagator_test.rb @@ -57,7 +57,7 @@ def set(carrier, key, value) end let(:baggage) do - OpenTelemetry.baggage + OpenTelemetry::Baggage end let(:propagator) do @@ -196,14 +196,6 @@ def set(carrier, key, value) end describe 'baggage handling' do - before do - OpenTelemetry.baggage = OpenTelemetry::Baggage::Manager.new - end - - after do - OpenTelemetry.baggage = nil - end - describe 'given valid baggage items' do it 'extracts baggage items' do carrier_with_baggage = carrier.merge( @@ -212,8 +204,8 @@ def set(carrier, key, value) ) context = propagator.extract(carrier_with_baggage, context: parent_context) - _(OpenTelemetry.baggage.value('foo', context: context)).must_equal('bar') - _(OpenTelemetry.baggage.value('bar', context: context)).must_equal('baz') + _(OpenTelemetry::Baggage.value('foo', context: context)).must_equal('bar') + _(OpenTelemetry::Baggage.value('bar', context: context)).must_equal('baz') end end @@ -225,8 +217,8 @@ def set(carrier, key, value) ) context = propagator.extract(carrier_with_baggage, context: parent_context) - _(OpenTelemetry.baggage.value('fθθ', context: context)).must_be_nil - _(OpenTelemetry.baggage.value('bar', context: context)).must_equal('baz') + _(OpenTelemetry::Baggage.value('fθθ', context: context)).must_be_nil + _(OpenTelemetry::Baggage.value('bar', context: context)).must_equal('baz') end end @@ -238,8 +230,8 @@ def set(carrier, key, value) ) context = propagator.extract(carrier_with_baggage, context: parent_context) - _(OpenTelemetry.baggage.value('foo', context: context)).must_be_nil - _(OpenTelemetry.baggage.value('bar', context: context)).must_equal('baz') + _(OpenTelemetry::Baggage.value('foo', context: context)).must_be_nil + _(OpenTelemetry::Baggage.value('bar', context: context)).must_equal('baz') end end end @@ -326,14 +318,6 @@ def set(carrier, key, value) end describe 'baggage handling' do - before do - OpenTelemetry.baggage = OpenTelemetry::Baggage::Manager.new - end - - after do - OpenTelemetry.baggage = nil - end - describe 'given valid baggage items' do it 'injects baggage items' do context_with_baggage = baggage.build(context: context) do |builder| diff --git a/sdk/lib/opentelemetry/sdk/configurator.rb b/sdk/lib/opentelemetry/sdk/configurator.rb index e3d5b270d..a3337a1c8 100644 --- a/sdk/lib/opentelemetry/sdk/configurator.rb +++ b/sdk/lib/opentelemetry/sdk/configurator.rb @@ -112,7 +112,6 @@ def add_span_processor(span_processor) def configure OpenTelemetry.logger = logger OpenTelemetry.error_handler = error_handler - OpenTelemetry.baggage = Baggage::Manager.new configure_propagation configure_span_processors tracer_provider.id_generator = @id_generator diff --git a/sdk/test/opentelemetry/sdk/configurator_test.rb b/sdk/test/opentelemetry/sdk/configurator_test.rb index f8bfffee1..08ba5e2ea 100644 --- a/sdk/test/opentelemetry/sdk/configurator_test.rb +++ b/sdk/test/opentelemetry/sdk/configurator_test.rb @@ -106,16 +106,6 @@ end describe '#configure' do - describe 'baggage' do - it 'is an instance of SDK::Baggage::Manager' do - configurator.configure - - _(OpenTelemetry.baggage).must_be_instance_of( - OpenTelemetry::Baggage::Manager - ) - end - end - describe 'propagators' do it 'defaults to trace context and baggage' do configurator.configure