lib/opentelemetry/instrumentation/graphql/instrumentation.rb in opentelemetry-instrumentation-graphql-0.21.0 vs lib/opentelemetry/instrumentation/graphql/instrumentation.rb in opentelemetry-instrumentation-graphql-0.21.1
- old
+ new
@@ -9,10 +9,14 @@
module OpenTelemetry
module Instrumentation
module GraphQL
# The Instrumentation class contains logic to detect and install the GraphQL instrumentation
class Instrumentation < OpenTelemetry::Instrumentation::Base
+ compatible do
+ gem_version < Gem::Version.new('3.0.0')
+ end
+
install do |config|
require_dependencies
install_tracer(config)
end
@@ -38,9 +42,13 @@
option :enable_platform_field, default: false, validate: :boolean
option :enable_platform_authorized, default: false, validate: :boolean
option :enable_platform_resolve_type, default: false, validate: :boolean
private
+
+ def gem_version
+ Gem::Version.new(::GraphQL::VERSION)
+ end
def require_dependencies
require_relative 'tracers/graphql_tracer'
end