lib/aspecto/opentelemetry.rb in aspecto-opentelemetry-0.1.6 vs lib/aspecto/opentelemetry.rb in aspecto-opentelemetry-0.1.7.rc0
- old
+ new
@@ -1,9 +1,10 @@
# frozen_string_literal: true
require_relative "opentelemetry/version"
require_relative "opentelemetry/configurator"
+require_relative "opentelemetry/propagator/aspecto"
require_relative "opentelemetry/resource/detectors/aspecto"
require_relative "opentelemetry/resource/detectors/deployment"
require_relative "opentelemetry/config/remote_config"
require "opentelemetry/sdk"
@@ -48,9 +49,13 @@
# https://github.com/sinatra/sinatra/blob/cd503e6c590cd48c2c9bb7869522494bfc62cb14/lib/sinatra/main.rb#L25
span_processor.force_flush timeout: 2
end
end
+ # Propagation
+ ::OpenTelemetry.propagation = ::Aspecto::OpenTelemetry::Propagator::Aspecto.from_configurator configurator
+
+ # Sampling
if configurator.require_config_for_traces
::OpenTelemetry.logger.info "[Aspecto] Require config for traces. Applying ALWAYS_OFF sampler"
::OpenTelemetry.tracer_provider.sampler = ::OpenTelemetry::SDK::Trace::Samplers::ALWAYS_OFF
end