lib/opentelemetry/instrumentation/graphql/instrumentation.rb in opentelemetry-instrumentation-graphql-0.26.3 vs lib/opentelemetry/instrumentation/graphql/instrumentation.rb in opentelemetry-instrumentation-graphql-0.26.4

- old
+ new

@@ -11,13 +11,13 @@ module GraphQL # The Instrumentation class contains logic to detect and install the GraphQL instrumentation class Instrumentation < OpenTelemetry::Instrumentation::Base compatible do if config[:legacy_tracing] - legacy_tracing_requirement_satisfied? + supports_legacy_tracer? else - Gem::Requirement.new('>= 2.0.18', '< 3.0.0').satisfied_by?(gem_version) + supports_new_tracer? end end install do |config| if config[:legacy_tracing] @@ -31,11 +31,15 @@ present do defined?(::GraphQL) end - def legacy_tracing_requirement_satisfied? - Gem::Requirement.new('<= 2.0.17').satisfied_by?(gem_version) || Gem::Requirement.new('2.0.19').satisfied_by?(gem_version) + def supports_legacy_tracer? + Gem::Requirement.new('!= 2.0.18').satisfied_by?(gem_version) + end + + def supports_new_tracer? + Gem::Requirement.new('>= 2.0.19').satisfied_by?(gem_version) end ## Supported configuration keys for the install config hash: # # The enable_platform_field key expects a boolean value,