-
Notifications
You must be signed in to change notification settings - Fork 377
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
389 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# frozen_string_literal: true | ||
|
||
module Datadog | ||
module Tracing | ||
module Contrib | ||
module GraphQL | ||
# Provides instrumentation for `graphql` through the GraphQL's tracing | ||
module TracingPatcher | ||
module_function | ||
|
||
def patch!(schemas, options) | ||
if schemas.empty? | ||
::GraphQL::Schema.tracer(::GraphQL::Tracing::DataDogTracing.new(**options)) | ||
else | ||
schemas.each do |schema| | ||
if schema.respond_to? :use | ||
schema.use(::GraphQL::Tracing::DataDogTracing, **options) | ||
else | ||
Datadog.logger.warn("Unable to patch #{schema}: Please migrate to class-based schema.") | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
module Datadog | ||
module Tracing | ||
module Contrib | ||
module GraphQL | ||
module TracePatcher | ||
def self?.patch!: (::Array[untyped] schemas, ::Hash[Symbol, untyped] options) -> untyped | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
module Datadog | ||
module Tracing | ||
module Contrib | ||
module GraphQL | ||
module TracingPatcher | ||
|
||
def self?.patch!: (::Array[untyped] schemas, ::Hash[Symbol, untyped] options) -> untyped | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.