Sha256: 2bab966bc85c30633b144faacb7307843e9b55a15decf2b150ad04db192b0bf2
Contents?: true
Size: 1.52 KB
Versions: 4
Compression:
Stored size: 1.52 KB
Contents
# frozen_string_literal: true require_relative '../analytics' require_relative '../patcher' require_relative 'tracing_patcher' require_relative 'trace_patcher' module Datadog module Tracing module Contrib module GraphQL # Provides instrumentation for `graphql` through the GraphQL tracing framework module Patcher include Contrib::Patcher module_function def target_version Integration.version end def patch if configuration[:with_deprecated_tracer] TracingPatcher.patch!(schemas, trace_options) elsif Integration.trace_supported? TracePatcher.patch!(schemas, trace_options) else Datadog.logger.warn( "GraphQL version (#{target_version}) does not support GraphQL::Tracing::DataDogTrace. "\ 'Falling back to GraphQL::Tracing::DataDogTracing.' ) TracingPatcher.patch!(schemas, trace_options) end end def trace_options { service: configuration[:service_name], analytics_enabled: Contrib::Analytics.enabled?(configuration[:analytics_enabled]), analytics_sample_rate: configuration[:analytics_sample_rate] } end def configuration Datadog.configuration.tracing[:graphql] end def schemas configuration[:schemas] end end end end end end
Version data entries
4 entries across 4 versions & 1 rubygems