lib/opentelemetry/instrumentation/trilogy/instrumentation.rb in opentelemetry-instrumentation-trilogy-0.59.1 vs lib/opentelemetry/instrumentation/trilogy/instrumentation.rb in opentelemetry-instrumentation-trilogy-0.59.2
- old
+ new
@@ -5,26 +5,10 @@
# SPDX-License-Identifier: Apache-2.0
module OpenTelemetry
module Instrumentation
module Trilogy
- # @api private
- class NoopPropagator
- EMPTY_LIST = [].freeze
- private_constant(:EMPTY_LIST)
-
- def inject(carrier, context: Context.current, setter: nil); end
-
- def extract(carrier, context: Context.current, getter: nil)
- context
- end
-
- def fields
- EMPTY_LIST
- end
- end
-
# The Instrumentation class contains logic to detect and install the Trilogy instrumentation
class Instrumentation < OpenTelemetry::Instrumentation::Base
install do |config|
require_dependencies
patch_client
@@ -59,13 +43,12 @@
def configure_propagator(config)
propagator = config[:propagator]
@propagator = case propagator
when 'vitess' then fetch_propagator(propagator, 'OpenTelemetry::Propagator::Vitess')
- when 'none', nil then NoopPropagator.new
+ when 'none', nil then nil
else
OpenTelemetry.logger.warn "The #{propagator} propagator is unknown and cannot be configured"
- NoopPropagator.new
end
end
def fetch_propagator(name, class_name, gem_suffix = name)
Kernel.const_get(class_name).sql_query_propagator