lib/opentelemetry/sdk/configurator.rb in opentelemetry-sdk-0.11.1 vs lib/opentelemetry/sdk/configurator.rb in opentelemetry-sdk-0.12.0
- old
+ new
@@ -14,11 +14,11 @@
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
+ :text_map_injectors, :error_handler, :id_generator
def initialize
@instrumentation_names = []
@instrumentation_config_map = {}
@http_extractors = nil
@@ -26,16 +26,21 @@
@text_map_extractors = nil
@text_map_injectors = nil
@span_processors = []
@use_mode = USE_MODE_UNSPECIFIED
@resource = Resources::Resource.telemetry_sdk
+ @id_generator = OpenTelemetry::Trace
end
def logger
@logger ||= OpenTelemetry.logger
end
+ def error_handler
+ @error_handler ||= OpenTelemetry.error_handler
+ end
+
# Accepts a resource object that is merged with the default telemetry sdk
# resource. The use of this method is optional, and is provided as means
# to include additional resource information.
# If a resource key collision occurs the passed in resource takes priority.
#
@@ -108,12 +113,14 @@
# - setup propagation
# - setup tracer_provider and meter_provider
# - install instrumentation
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
OpenTelemetry.tracer_provider = tracer_provider
install_instrumentation
end
private