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
Copy file name to clipboardExpand all lines: docs/platforms/android/integrations/apollo4/index.mdx
+11-5Lines changed: 11 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -128,15 +128,15 @@ This feature automatically captures GraphQL client errors (like bad operations a
128
128
129
129
Sentry will group GraphQL client errors by the `operationName`, `operationType`, and `statusCode`, so that you can easily see the number of errors that happened for each.
130
130
131
-
Starting with SDK version `7.0.0`, GraphQL client error capturing is enabled by default. For prior versions of the SDK, this feature is opt-in and can be enabled by setting the `captureFailedRequests` option to `true`:
131
+
This feature is enabled by defaultand can be disabled by setting the `captureFailedRequests` option to `false`:
132
132
133
133
```kotlin
134
134
importcom.apollographql.ApolloClient
135
135
importio.sentry.apollo4.sentryTracing
136
136
137
137
val apollo =ApolloClient.builder()
138
138
.serverUrl("https://your-api-host/")
139
-
.sentryTracing(captureFailedRequests =true)
139
+
.sentryTracing(captureFailedRequests =false)
140
140
.build()
141
141
```
142
142
@@ -156,6 +156,12 @@ val apollo = ApolloClient.builder()
156
156
157
157
By default, error events won't contain `Headers` or `Cookies`, but you can change this behavior by setting the `sendDefaultPii` option to `true`:
@@ -168,17 +174,17 @@ Alternatively, you can customize the event and scrub the data yourself.
168
174
169
175
### Customize or Drop the Error Event
170
176
171
-
To customize or drop the error event, you'll need to do a [manual initialization](/platforms/android/configuration/manual-init/#manual-initialization) of the Sentry Android SDK. The captured error event can then be customized or dropped with a `BeforeSendCallback`:
177
+
The captured error event can be customized or dropped with a `BeforeSendCallback`:
172
178
173
179
```kotlin
174
-
importio.sentry.android.core.SentryAndroid
180
+
importio.sentry.Sentry
175
181
importio.sentry.SentryOptions.BeforeSendCallback
176
182
importcom.apollographql.api.http.HttpRequest
177
183
importcom.apollographql.api.http.HttpResponse
178
184
importio.sentry.TypeCheckHint.APOLLO_REQUEST
179
185
importio.sentry.TypeCheckHint.APOLLO_RESPONSE
180
186
181
-
SentryAndroid.init(this) { options ->
187
+
Sentry.init { options ->
182
188
// Add a callback that will be used before the event is sent to Sentry.
183
189
// With this callback, you can modify the event or, when returning null, also discard the event.
184
190
options.beforeSend =BeforeSendCallback { event, hint ->
Copy file name to clipboardExpand all lines: docs/platforms/java/common/tracing/instrumentation/apollo4.mdx
+1-19Lines changed: 1 addition & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -102,25 +102,7 @@ val apollo = ApolloClient.builder()
102
102
103
103
<Alerttitle="Important">
104
104
105
-
Apollo Kotlin is built with Kotlin coroutines. This means that `SentryApolloInterceptor` can be used with Java using only Global Hub Mode (single Hub used by all threads), with Kotlin using single Hub mode, or with <PlatformLinkto="/enriching-events/scopes/#kotlin-coroutines">Sentry's coroutines support</PlatformLink>.
106
-
107
-
</Alert>
108
-
109
-
## Using With Java
110
-
111
-
Configure Global Hub Mode:
112
-
113
-
```java
114
-
importio.sentry.Sentry;
115
-
116
-
Sentry.init(options -> {
117
-
..
118
-
}, true)
119
-
```
120
-
121
-
<Alert>
122
-
123
-
In Global Hub Mode, all threads use the same Hub.
105
+
Apollo Kotlin is built with Kotlin coroutines. This means that `SentryApolloInterceptor` can only be used with Kotlin using single Hub mode, or with <PlatformLinkto="/enriching-events/scopes/#kotlin-coroutines">Sentry's coroutines support</PlatformLink>.
0 commit comments