lib/opentelemetry/sdk/configurator.rb in opentelemetry-sdk-0.13.1 vs lib/opentelemetry/sdk/configurator.rb in opentelemetry-sdk-0.14.0

- old
+ new

@@ -13,20 +13,18 @@ USE_MODE_ONE = 1 USE_MODE_ALL = 2 private_constant :USE_MODE_UNSPECIFIED, :USE_MODE_ONE, :USE_MODE_ALL - attr_writer :logger, :http_extractors, :http_injectors, :text_map_extractors, - :text_map_injectors, :error_handler, :id_generator + attr_writer :logger, :extractors, :injectors, :error_handler, + :id_generator def initialize @instrumentation_names = [] @instrumentation_config_map = {} - @http_extractors = nil - @http_injectors = nil - @text_map_extractors = nil - @text_map_injectors = nil + @injectors = nil + @extractors = nil @span_processors = [] @use_mode = USE_MODE_UNSPECIFIED @resource = Resources::Resource.default @id_generator = OpenTelemetry::Trace end @@ -154,42 +152,29 @@ Trace::Export::ConsoleSpanExporter.new ) end def configure_propagation - OpenTelemetry.propagation.http = create_propagator(@http_injectors || default_http_injectors, - @http_extractors || default_http_extractors) - OpenTelemetry.propagation.text = create_propagator(@text_map_injectors || default_text_map_injectors, - @text_map_extractors || default_text_map_extractors) + OpenTelemetry.propagation = create_propagator(@injectors || default_injectors, + @extractors || default_extractors) end def create_propagator(injectors, extractors) if injectors.size > 1 || extractors.size > 1 Context::Propagation::CompositePropagator.new(injectors, extractors) else Context::Propagation::Propagator.new(injectors, extractors) end end - def default_http_injectors - default_text_map_injectors - end - - def default_http_extractors + def default_injectors [ - OpenTelemetry::Trace::Propagation::TraceContext.rack_extractor, - OpenTelemetry::Baggage::Propagation.rack_extractor - ] - end - - def default_text_map_injectors - [ OpenTelemetry::Trace::Propagation::TraceContext.text_map_injector, OpenTelemetry::Baggage::Propagation.text_map_injector ] end - def default_text_map_extractors + def default_extractors [ OpenTelemetry::Trace::Propagation::TraceContext.text_map_extractor, OpenTelemetry::Baggage::Propagation.text_map_extractor ] end