Skip to content

Commit e9c0314

Browse files
committed
update docs, remove legacy SentryTracing
1 parent 9b44a31 commit e9c0314

File tree

5 files changed

+16
-172
lines changed

5 files changed

+16
-172
lines changed

guides/queries/tracing.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ By default, GraphQL-Ruby makes a new trace instance when it runs a query. You ca
3939
You can attach a trace module to run only in some circumstances by using `mode:`. For example, to add detailed tracing for only some requests:
4040

4141
```ruby
42-
trace_with DetailedTracing, mode: :detailed_metrics
42+
trace_with DetailedTrace, mode: :detailed_metrics
4343
```
4444

4545
Then, to opt into that trace, use `context: { trace_mode: :detailed_metrics, ... }` when executing queries.
@@ -75,7 +75,7 @@ tracing as follows:
7575
require 'appoptics_apm'
7676

7777
class MySchema < GraphQL::Schema
78-
use(GraphQL::Tracing::AppOpticsTracing)
78+
trace_with GraphQL::Tracing::AppOpticsTrace
7979
end
8080
```
8181
<div class="monitoring-img-group">
@@ -88,7 +88,7 @@ To add [AppSignal](https://appsignal.com/) instrumentation:
8888

8989
```ruby
9090
class MySchema < GraphQL::Schema
91-
use(GraphQL::Tracing::AppsignalTracing)
91+
trace_with GraphQL::Tracing::AppsignalTrace
9292
end
9393
```
9494

@@ -102,9 +102,9 @@ To add [New Relic](https://newrelic.com/) instrumentation:
102102

103103
```ruby
104104
class MySchema < GraphQL::Schema
105-
use(GraphQL::Tracing::NewRelicTracing)
105+
trace_with GraphQL::Tracing::NewRelicTrace
106106
# Optional, use the operation name to set the new relic transaction name:
107-
# use(GraphQL::Tracing::NewRelicTracing, set_transaction_name: true)
107+
# trace_with GraphQL::Tracing::NewRelicTrace, set_transaction_name: true
108108
end
109109
```
110110

@@ -119,7 +119,7 @@ To add [Scout APM](https://scoutapp.com/) instrumentation:
119119

120120
```ruby
121121
class MySchema < GraphQL::Schema
122-
use(GraphQL::Tracing::ScoutTracing)
122+
trace_with GraphQL::Tracing::ScoutTrace
123123
end
124124
```
125125

@@ -148,7 +148,7 @@ To add [Datadog](https://www.datadoghq.com) instrumentation:
148148

149149
```ruby
150150
class MySchema < GraphQL::Schema
151-
use(GraphQL::Tracing::DataDogTracing, options)
151+
trace_with GraphQL::Tracing::DataDogTrace, options
152152
end
153153
```
154154

@@ -169,7 +169,7 @@ To add [Prometheus](https://prometheus.io) instrumentation:
169169
require 'prometheus_exporter/client'
170170

171171
class MySchema < GraphQL::Schema
172-
use(GraphQL::Tracing::PrometheusTracing)
172+
trace_with GraphQL::Tracing::PrometheusTrace
173173
end
174174
```
175175

@@ -181,7 +181,7 @@ The PrometheusExporter server must be run with a custom type collector that exte
181181
if defined?(PrometheusExporter::Server)
182182
require 'graphql/tracing'
183183

184-
class GraphQLCollector < GraphQL::Tracing::PrometheusTracing::GraphQLCollector
184+
class GraphQLCollector < GraphQL::Tracing::PrometheusTrace::GraphQLCollector
185185
end
186186
end
187187
```
@@ -196,7 +196,7 @@ To add [Sentry](https://sentry.io) instrumentation:
196196

197197
```ruby
198198
class MySchema < GraphQL::Schema
199-
use(GraphQL::Tracing::SentryTracing)
199+
trace_with GraphQL::Tracing::SentryTrace
200200
end
201201
```
202202

@@ -207,14 +207,14 @@ end
207207

208208
## Statsd
209209

210-
You can add Statsd instrumentation by initializing a statsd client and passing it to {{ "GraphQL::Tracing::StatsdTracing" | api_doc }}:
210+
You can add Statsd instrumentation by initializing a statsd client and passing it to {{ "GraphQL::Tracing::StatsdTrace" | api_doc }}:
211211

212212
```ruby
213213
$statsd = Statsd.new 'localhost', 9125
214214
# ...
215215

216216
class MySchema < GraphQL::Schema
217-
use GraphQL::Tracing::StatsdTracing, statsd: $statsd
217+
use GraphQL::Tracing::StatsdTrace, statsd: $statsd
218218
end
219219
```
220220

lib/graphql/tracing.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
require "graphql/tracing/appsignal_tracing"
1010
require "graphql/tracing/data_dog_tracing"
1111
require "graphql/tracing/new_relic_tracing"
12-
require "graphql/tracing/sentry_tracing"
1312
require "graphql/tracing/scout_tracing"
1413
require "graphql/tracing/statsd_tracing"
1514
require "graphql/tracing/prometheus_tracing"
@@ -27,7 +26,7 @@
2726
require "graphql/tracing/statsd_trace"
2827
require "graphql/tracing/prometheus_trace"
2928
if defined?(PrometheusExporter::Server)
30-
require "graphql/tracing/prometheus_tracing/graphql_collector"
29+
require "graphql/tracing/prometheus_trace/graphql_collector"
3130
end
3231

3332
module GraphQL

lib/graphql/tracing/prometheus_tracing/graphql_collector.rb renamed to lib/graphql/tracing/prometheus_trace/graphql_collector.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
module GraphQL
44
module Tracing
5-
class PrometheusTracing < PlatformTracing
5+
module PrometheusTrace
66
class GraphQLCollector < ::PrometheusExporter::Server::TypeCollector
77
def initialize
88
@graphql_gauge = PrometheusExporter::Metric::Base.default_aggregation.new(
@@ -28,5 +28,7 @@ def metrics
2828
end
2929
end
3030
end
31+
# Backwards-compat:
32+
PrometheusTracing::GraphQLCollector = PrometheusTrace::GraphQLCollector
3133
end
3234
end

lib/graphql/tracing/sentry_tracing.rb

Lines changed: 0 additions & 63 deletions
This file was deleted.

spec/graphql/tracing/sentry_tracing_spec.rb

Lines changed: 0 additions & 94 deletions
This file was deleted.

0 commit comments

Comments
 (0)