Skip to content

Commit

Permalink
Deprecate tracer option
Browse files Browse the repository at this point in the history
  • Loading branch information
TonyCTHsu committed Jan 23, 2024
1 parent 791256c commit 72e51d3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
8 changes: 1 addition & 7 deletions guides/queries/tracing.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,16 +148,10 @@ To add [Datadog](https://www.datadoghq.com) instrumentation:

```ruby
class MySchema < GraphQL::Schema
use(GraphQL::Tracing::DataDogTracing, options)
use(GraphQL::Tracing::DataDogTracing)
end
```

You may provide `options` as a `Hash` with the following values:

| Key | Description | Default |
| --- | ----------- | ------- |
| `tracer` | Tracer used to perform instrumentation. Usually you don't need to set this. | `Datadog::Tracing` |

For more details about Datadog's tracing API, check out the [Ruby documentation](https://github.com/DataDog/dd-trace-rb/blob/master/docs/GettingStarted.md) or the [APM documentation](https://docs.datadoghq.com/tracing/) for more product information.

## Prometheus
Expand Down
1 change: 1 addition & 0 deletions lib/graphql/tracing/data_dog_trace.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
module GraphQL
module Tracing
module DataDogTrace
# @param tracer [#trace] Deprecated
# @param analytics_enabled [Boolean] Deprecated
# @param analytics_sample_rate [Float] Deprecated
def initialize(tracer: nil, analytics_enabled: false, analytics_sample_rate: 1.0, service: nil, **rest)
Expand Down
1 change: 1 addition & 0 deletions lib/graphql/tracing/data_dog_tracing.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def prepare_span(key, data, span)
def tracer
default_tracer = defined?(Datadog::Tracing) ? Datadog::Tracing : Datadog.tracer

# [Deprecated] options[:tracer] will be removed in the future
options.fetch(:tracer, default_tracer)
end

Expand Down

0 comments on commit 72e51d3

Please sign in to comment.