lib/opentelemetry/instrumentation/aws_sdk/instrumentation.rb in aspecto-opentelemetry-instrumentation-aws_sdk-0.1.8 vs lib/opentelemetry/instrumentation/aws_sdk/instrumentation.rb in aspecto-opentelemetry-instrumentation-aws_sdk-0.3.0

- old
+ new

@@ -7,11 +7,11 @@ module OpenTelemetry module Instrumentation module AwsSdk # Instrumentation class that detects and installs the AwsSdk instrumentation class Instrumentation < OpenTelemetry::Instrumentation::Base - MINIMUM_VERSION = Gem::Version.new('2.0') + MINIMUM_VERSION = Gem::Version.new('2.0.0') install do |_config| require_dependencies add_plugin(Seahorse::Client::Base, *loaded_constants) end @@ -19,21 +19,22 @@ present do !defined?(::Seahorse::Client::Base).nil? end compatible do - gem_version >= MINIMUM_VERSION + !gem_version.nil? && gem_version >= MINIMUM_VERSION end - option :extract_messaging_context, default: false, validate: :boolean option :inject_messaging_context, default: false, validate: :boolean option :suppress_internal_instrumentation, default: false, validate: :boolean def gem_version if Gem.loaded_specs['aws-sdk'] Gem.loaded_specs['aws-sdk'].version elsif Gem.loaded_specs['aws-sdk-core'] Gem.loaded_specs['aws-sdk-core'].version + elsif defined?(::Aws::CORE_GEM_VERSION) + Gem::Version.new(::Aws::CORE_GEM_VERSION) end end private