Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
marcotc committed Jan 16, 2025
1 parent 3c215ae commit 840c622
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/datadog/tracing/contrib/graphql/patcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,14 @@ def patch
# DEV-3.0: `with_unified_tracer: false` should be removed if possible.
# DEV-3.0: `with_unified_tracer: true` should be the default and hopefully not even necessary as an option.
if configuration[:with_deprecated_tracer]
puts "Patching GraphQL with TracingPatcher"
TracingPatcher.patch!(schemas)
elsif Integration.trace_supported?
if configuration[:with_unified_tracer]
puts "Patching GraphQL with UnifiedTracePatcher"
UnifiedTracePatcher.patch!(schemas)
else
puts "Patching GraphQL with TracePatcher"
TracePatcher.patch!(schemas)
end
else
Expand All @@ -40,6 +43,7 @@ def patch
'or Datadog::Tracing::Contrib::GraphQL::UnifiedTrace.'\
'Falling back to GraphQL::Tracing::DataDogTracing.'
)
puts "Patching GraphQL with TracingPatcher"
TracingPatcher.patch!(schemas)
end
end
Expand Down
1 change: 1 addition & 0 deletions lib/datadog/tracing/contrib/graphql/tracing_patcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ module TracingPatcher
module_function

def patch!(schemas)
puts "Patching GraphQL with DataDogTracing"
if schemas.empty?
::GraphQL::Schema.tracer(::GraphQL::Tracing::DataDogTracing.new)
else
Expand Down

0 comments on commit 840c622

Please sign in to comment.