You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -36,189 +36,25 @@ For a full list of methods and their arguments, see {{ "GraphQL::Tracing::Trace"
36
36
37
37
By default, GraphQL-Ruby makes a new trace instance when it runs a query. You can pass an existing instance as `context: { trace: ... }`. Also, `GraphQL.parse( ..., trace: ...)` accepts a trace instance.
38
38
39
-
## Trace Modes
39
+
## Detailed Traces
40
40
41
-
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:
41
+
You can capture detailed traces of query execution with {{ "Tracing::DetailedTrace" | api_doc }}. They can be viewed in Google's [Perfetto Trace Viewer](https://ui.perfetto.dev). They include a per-Fiber breakdown with links between fields and Dataloader sources.
42
42
43
-
```ruby
44
-
trace_with DetailedTrace, mode::detailed_metrics
45
-
```
46
-
47
-
Then, to opt into that trace, use `context: { trace_mode: :detailed_metrics, ... }` when executing queries.
48
-
49
-
Any custom trace modes _also_ include the default `trace_with ...` modules (that is, those added _without_ any particular `mode: ...` configuration).
50
-
51
-
## Perfetto Traces
52
-
53
-
For detailed profiles of complex queries, try {{ "Tracing::PerfettoTrace" | api_doc }}. Its trace can be viewed in Google's [Perfetto Trace Viewer](https://ui.perfetto.dev). They include a per-Fiber breakdown with links between fields and Dataloader sources.
To add [Skylight](https://www.skylight.io) instrumentation, you may either enable the [GraphQL probe](https://www.skylight.io/support/getting-more-from-skylight#graphql) or use [ActiveSupportNotificationsTracing](/queries/tracing.html#activesupportnotifications).
GraphQL instrumentation for Skylight is available in versions >= 4.2.0.
154
-
155
-
## Datadog
156
-
157
-
To add [Datadog](https://www.datadoghq.com) instrumentation:
158
-
159
-
```ruby
160
-
classMySchema < GraphQL::Schema
161
-
trace_with GraphQL::Tracing::DataDogTrace
162
-
end
163
-
```
164
-
165
-
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.
166
-
167
-
## Prometheus
168
-
169
-
To add [Prometheus](https://prometheus.io) instrumentation:
170
-
171
-
```ruby
172
-
require'prometheus_exporter/client'
173
-
174
-
classMySchema < GraphQL::Schema
175
-
trace_with GraphQL::Tracing::PrometheusTrace
176
-
end
177
-
```
178
-
179
-
The PrometheusExporter server must be run with a custom type collector that extends
You can add Statsd instrumentation by initializing a statsd client and passing it to {{ "GraphQL::Tracing::StatsdTrace" | api_doc }}:
214
-
215
-
```ruby
216
-
$statsd=Statsd.new'localhost', 9125
217
-
# ...
218
-
219
-
classMySchema < GraphQL::Schema
220
-
use GraphQL::Tracing::StatsdTrace, statsd:$statsd
221
-
end
222
-
```
49
+
There integrations for GraphQL-Ruby with several other monitoring systems:
223
50
224
-
Any Statsd client that implements `.time(name) { ... }` will work.
51
+
-`ActiveSupport::Notifications`: See {{ "Tracing::ActiveSupportNotificationsTrace" | api_doc }}.
52
+
-[AppOptics](https://appoptics.com/) instrumentation is automatic in `appoptics_apm` v4.11.0+.
53
+
-[AppSignal](https://appsignal.com/): See {{ "Tracing::AppsignalTrace" | api_doc }}.
54
+
-[Datadog](https://www.datadoghq.com): See {{ "Tracing::DataDogTrace" | api_doc }}.
55
+
-[NewRelic](https://newrelic.com/): See {{ "Tracing::NewRelicTrace" | api_doc }}.
56
+
-[Prometheus](https://prometheus.io): See {{ "Tracing::PrometheusTrace" | api_doc }}.
57
+
-[Scout APM](https://scoutapp.com/): See {{ "Tracing::ScoutTrace" | api_doc }}.
58
+
-[Sentry](https://sentry.io): See {{ "Tracing::SentryTrace" | api_doc }}.
59
+
-[Skylight](https://www.skylight.io): either enable the [GraphQL probe](https://www.skylight.io/support/getting-more-from-skylight#graphql) or use {{ "Tracing::ActiveSupportNotificationsTrace" | api_doc }}.
60
+
- Statsd: See {{ "Tracing::StatsdTrace" | api_doc }}.
0 commit comments