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

Trace with UnifiedTracer does not respect service option #4170

Open
cosmini opened this issue Nov 28, 2024 · 1 comment
Open

Trace with UnifiedTracer does not respect service option #4170

cosmini opened this issue Nov 28, 2024 · 1 comment
Assignees
Labels
bug Involves a bug community Was opened by a community member

Comments

@cosmini
Copy link

cosmini commented Nov 28, 2024

Current behaviour

When datadog tracing is configured manually on the schema as described in docs it doesn't apply the custom service option, instead it applies the service name from the global configuration.

This is not on par with graphql's own tracer (trace_with GraphQL::Tracing::DataDogTrace, service: 'my-service-name') which is no longer recommended to be used for the latest version of datadog & graphql gems.
Since this solution of providing service name via options was recommended at version 2.1.11 it is more likely this is a bug in the unified tracer.

Will result in the service name being set to default value of nil:

Service: nil

Expected behaviour

Service: 'my-service-name'

Steps to reproduce

For example having a schema configured like this and no other instrumentation for graphql configured

class YourSchema < GraphQL::Schema
  trace_with Datadog::Tracing::Contrib::GraphQL::UnifiedTrace, service: 'my-service-name'
end 

Environment

  • datadog version: 2.7.0
  • Configuration block:
Datadog.configure do |c|
  app_name = ENV['DD_SERVICE'] || ENV['DATADOG_SERVICE_NAME']
  env_name = Rails.env

  c.env = env_name
  c.runtime_metrics.enabled = true
  c.runtime_metrics.statsd = DATADOG_STATSD_CLIENT
  c.service = app_name
  c.tags = {
    'application' => app_name,
    'environment' => env_name,
  }

  c.tracing.instrument :rails, service_name: app_name, request_queuing: true
end
  • Ruby version: 3.3.4
  • Operating system: osx, debian
  • Relevant library versions: graphql: 2.4.3
@cosmini cosmini added bug Involves a bug community Was opened by a community member labels Nov 28, 2024
@marcotc marcotc self-assigned this Nov 29, 2024
@marcotc
Copy link
Member

marcotc commented Nov 29, 2024

👋 @cosmini, we did some work to address this issue in #3859, but it looks like you are using a newer version of our gem, so upgrading won't fix your issue.
We'll take a look into this issue in the coming days.

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