Class: OpenTelemetry::Instrumentation::GraphQL::Instrumentation

Inherits:
Base
  • Object
show all
Defined in:
lib/opentelemetry/instrumentation/graphql/instrumentation.rb

Overview

The Instrumentation class contains logic to detect and install the GraphQL instrumentation

Instance Method Summary collapse

Instance Method Details

#dataloader_has_spawn_fiber?Boolean

Returns:

  • (Boolean)


46
47
48
# File 'lib/opentelemetry/instrumentation/graphql/instrumentation.rb', line 46

def dataloader_has_spawn_fiber?
  Gem::Requirement.new('>= 2.1.8').satisfied_by?(gem_version)
end

#schemasObject

Supported configuration keys for the install config hash:

The enable_platform_field key expects a boolean value, and enables the tracing of "execute_field" and "execute_field_lazy".

The enable_platform_authorized key expects a boolean value, and enables the tracing of "authorized" and "authorized_lazy".

The enable_platform_resolve_type key expects a boolean value, and enables the tracing of "resolve_type" and "resolve_type_lazy".

The legacy_platform_span_names key expects a boolean value, and controls if platform tracing (field/authorized/resolve_type) should use the legacy span names (e.g. "MyType.myField") or the new normalized span names (e.g. "graphql.execute_field").

The schemas key expects an array of Schemas, and is used to specify which schemas are to be instrumented. If this value is not supplied the default behavior is to instrument all schemas.



69
# File 'lib/opentelemetry/instrumentation/graphql/instrumentation.rb', line 69

option :schemas,                      default: [],    validate: :array

#supports_legacy_tracer?Boolean

Returns:

  • (Boolean)


38
39
40
# File 'lib/opentelemetry/instrumentation/graphql/instrumentation.rb', line 38

def supports_legacy_tracer?
  Gem::Requirement.new('!= 2.0.18').satisfied_by?(gem_version)
end

#supports_new_tracer?Boolean

Returns:

  • (Boolean)


42
43
44
# File 'lib/opentelemetry/instrumentation/graphql/instrumentation.rb', line 42

def supports_new_tracer?
  Gem::Requirement.new('>= 2.0.19').satisfied_by?(gem_version)
end