Sha256: f6d19168e24c064979e80bb992aa0b9cdd0c552972845199758ba3f2a01c3905

Contents?: true

Size: 616 Bytes

Versions: 6

Compression:

Stored size: 616 Bytes

Contents

# frozen_string_literal: true

module Datadog
  module Tracing
    module Contrib
      module GraphQL
        # Provides instrumentation for `graphql` through with GraphQL's trace
        module TracePatcher
          module_function

          def patch!(schemas, options)
            if schemas.empty?
              ::GraphQL::Schema.trace_with(::GraphQL::Tracing::DataDogTrace, **options)
            else
              schemas.each do |schema|
                schema.trace_with(::GraphQL::Tracing::DataDogTrace, **options)
              end
            end
          end
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
datadog-2.3.0 lib/datadog/tracing/contrib/graphql/trace_patcher.rb
datadog-2.2.0 lib/datadog/tracing/contrib/graphql/trace_patcher.rb
datadog-2.1.0 lib/datadog/tracing/contrib/graphql/trace_patcher.rb
datadog-2.0.0 lib/datadog/tracing/contrib/graphql/trace_patcher.rb
datadog-2.0.0.beta2 lib/datadog/tracing/contrib/graphql/trace_patcher.rb
datadog-2.0.0.beta1 lib/datadog/tracing/contrib/graphql/trace_patcher.rb