Skip to content

Commit

Permalink
update docs, remove legacy SentryTracing
Browse files Browse the repository at this point in the history
  • Loading branch information
rmosolgo committed Jan 12, 2024
1 parent 9b44a31 commit e9c0314
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 172 deletions.
24 changes: 12 additions & 12 deletions guides/queries/tracing.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ By default, GraphQL-Ruby makes a new trace instance when it runs a query. You ca
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:

```ruby
trace_with DetailedTracing, mode: :detailed_metrics
trace_with DetailedTrace, mode: :detailed_metrics
```

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

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

```ruby
class MySchema < GraphQL::Schema
use(GraphQL::Tracing::AppsignalTracing)
trace_with GraphQL::Tracing::AppsignalTrace
end
```

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

```ruby
class MySchema < GraphQL::Schema
use(GraphQL::Tracing::NewRelicTracing)
trace_with GraphQL::Tracing::NewRelicTrace
# Optional, use the operation name to set the new relic transaction name:
# use(GraphQL::Tracing::NewRelicTracing, set_transaction_name: true)
# trace_with GraphQL::Tracing::NewRelicTrace, set_transaction_name: true
end
```

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

```ruby
class MySchema < GraphQL::Schema
use(GraphQL::Tracing::ScoutTracing)
trace_with GraphQL::Tracing::ScoutTrace
end
```

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

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

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

class MySchema < GraphQL::Schema
use(GraphQL::Tracing::PrometheusTracing)
trace_with GraphQL::Tracing::PrometheusTrace
end
```

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

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

```ruby
class MySchema < GraphQL::Schema
use(GraphQL::Tracing::SentryTracing)
trace_with GraphQL::Tracing::SentryTrace
end
```

Expand All @@ -207,14 +207,14 @@ end

## Statsd

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

```ruby
$statsd = Statsd.new 'localhost', 9125
# ...

class MySchema < GraphQL::Schema
use GraphQL::Tracing::StatsdTracing, statsd: $statsd
use GraphQL::Tracing::StatsdTrace, statsd: $statsd
end
```

Expand Down
3 changes: 1 addition & 2 deletions lib/graphql/tracing.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
require "graphql/tracing/appsignal_tracing"
require "graphql/tracing/data_dog_tracing"
require "graphql/tracing/new_relic_tracing"
require "graphql/tracing/sentry_tracing"
require "graphql/tracing/scout_tracing"
require "graphql/tracing/statsd_tracing"
require "graphql/tracing/prometheus_tracing"
Expand All @@ -27,7 +26,7 @@
require "graphql/tracing/statsd_trace"
require "graphql/tracing/prometheus_trace"
if defined?(PrometheusExporter::Server)
require "graphql/tracing/prometheus_tracing/graphql_collector"
require "graphql/tracing/prometheus_trace/graphql_collector"
end

module GraphQL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module GraphQL
module Tracing
class PrometheusTracing < PlatformTracing
module PrometheusTrace
class GraphQLCollector < ::PrometheusExporter::Server::TypeCollector
def initialize
@graphql_gauge = PrometheusExporter::Metric::Base.default_aggregation.new(
Expand All @@ -28,5 +28,7 @@ def metrics
end
end
end
# Backwards-compat:
PrometheusTracing::GraphQLCollector = PrometheusTrace::GraphQLCollector
end
end
63 changes: 0 additions & 63 deletions lib/graphql/tracing/sentry_tracing.rb

This file was deleted.

94 changes: 0 additions & 94 deletions spec/graphql/tracing/sentry_tracing_spec.rb

This file was deleted.

0 comments on commit e9c0314

Please sign in to comment.