Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GraphQL unified tracer not autoloaded #3804

Closed
WoutDev opened this issue Jul 23, 2024 · 3 comments
Closed

GraphQL unified tracer not autoloaded #3804

WoutDev opened this issue Jul 23, 2024 · 3 comments
Assignees
Labels
bug Involves a bug community Was opened by a community member
Milestone

Comments

@WoutDev
Copy link

WoutDev commented Jul 23, 2024

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

  • datadog version: 2.2.0
  • Configuration block (Datadog.configure ...):
Datadog.configure do |c|
  c.runtime_metrics.enabled = true

  # REDACTED: some non-graphql instrumentation here

  c.tracing.report_hostname = true

  c.profiling.allocation_enabled = true
end
  • Ruby version: 3.3.0
  • Operating system: Windows 11 WSL2 Ubuntu 22.04
  • Relevant library versions: N/A
@WoutDev WoutDev added bug Involves a bug community Was opened by a community member labels Jul 23, 2024
@vpellan vpellan self-assigned this Jul 24, 2024
@vpellan
Copy link
Contributor

vpellan commented Jul 25, 2024

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

@vpellan
Copy link
Contributor

vpellan commented Aug 6, 2024

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

@vpellan vpellan closed this as completed Aug 6, 2024
@vpellan vpellan added this to the 2.3.0 milestone Aug 6, 2024
@vpellan
Copy link
Contributor

vpellan commented Aug 22, 2024

Hello! 2.3.0 just released, give it a try!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Involves a bug community Was opened by a community member
Projects
None yet
Development

No branches or pull requests

2 participants