DataDog / dd-trace-rb

Datadog Tracing Ruby Client
https://docs.datadoghq.com/tracing/
Other
307 stars 375 forks source link

GraphQL unified tracer not autoloaded #3804

Closed WoutDev closed 2 months ago

WoutDev commented 2 months ago

Current behaviour Following the documentation, I'm getting a NameError when attempting to use the new GraphQL unified tracer:

NameError:
  uninitialized constant Datadog::Tracing::Contrib::GraphQL::UnifiedTrace

This is solved by requiring the file manually:

require 'datadog/tracing/contrib/graphql/unified_trace'

So not sure if this is a documentation issue, or it should be autoloaded while it is not.

Expected behaviour Looking at the documentation, it looks like a drop-in replacement for GraphQL::Tracing::DataDogTrace and 'just work' instead of raising a NameError.

Steps to reproduce Use a custom tracer based on UnifiedTrace:

# frozen_string_literal: true

module Util
  module DatadogTracer
    include Datadog::Tracing::Contrib::GraphQL::UnifiedTrace

    def prepare_span(key, data, span)
      # REDACTED: add some tags
    end
  end
end

and trace_with the custom tracer like this:

# frozen_string_literal: true

class SomeSchema < GraphQL::Schema
  trace_with Util::DatadogTracer
end

How does datadog help you? Some great tracing and profiling :)

Environment

vpellan commented 2 months ago

Hello ! Thanks for the report ! We're currently looking into this !

vpellan commented 2 months ago

Hello ! A fix will be available in the next release, thanks for your patience !

vpellan commented 1 month ago

Hello! 2.3.0 just released, give it a try!