Skip to content

Commit 8ed6e7c

Browse files
committed
improve
1 parent b8e80c6 commit 8ed6e7c

File tree

2 files changed

+12
-24
lines changed

2 files changed

+12
-24
lines changed

docs/platforms/android/integrations/apollo4/index.mdx

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,15 +128,15 @@ This feature automatically captures GraphQL client errors (like bad operations a
128128

129129
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.
130130

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 default and can be disabled by setting the `captureFailedRequests` option to `false`:
132132

133133
```kotlin
134134
import com.apollographql.ApolloClient
135135
import io.sentry.apollo4.sentryTracing
136136

137137
val apollo = ApolloClient.builder()
138138
.serverUrl("https://your-api-host/")
139-
.sentryTracing(captureFailedRequests = true)
139+
.sentryTracing(captureFailedRequests = false)
140140
.build()
141141
```
142142

@@ -156,6 +156,12 @@ val apollo = ApolloClient.builder()
156156

157157
By default, error events won't contain `Headers` or `Cookies`, but you can change this behavior by setting the `sendDefaultPii` option to `true`:
158158

159+
```kotlin
160+
Sentry.init { options ->
161+
options.isSendDefaultPii = true
162+
}
163+
```
164+
159165
```xml {filename:AndroidManifest.xml}
160166
<application>
161167
<meta-data android:name="io.sentry.send-default-pii" android:value="true" />
@@ -168,17 +174,17 @@ Alternatively, you can customize the event and scrub the data yourself.
168174

169175
### Customize or Drop the Error Event
170176

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`:
172178

173179
```kotlin
174-
import io.sentry.android.core.SentryAndroid
180+
import io.sentry.Sentry
175181
import io.sentry.SentryOptions.BeforeSendCallback
176182
import com.apollographql.api.http.HttpRequest
177183
import com.apollographql.api.http.HttpResponse
178184
import io.sentry.TypeCheckHint.APOLLO_REQUEST
179185
import io.sentry.TypeCheckHint.APOLLO_RESPONSE
180186

181-
SentryAndroid.init(this) { options ->
187+
Sentry.init { options ->
182188
// Add a callback that will be used before the event is sent to Sentry.
183189
// With this callback, you can modify the event or, when returning null, also discard the event.
184190
options.beforeSend = BeforeSendCallback { event, hint ->

docs/platforms/java/common/tracing/instrumentation/apollo4.mdx

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -102,25 +102,7 @@ val apollo = ApolloClient.builder()
102102

103103
<Alert title="Important">
104104

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 <PlatformLink to="/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-
import io.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 <PlatformLink to="/enriching-events/scopes/#kotlin-coroutines">Sentry's coroutines support</PlatformLink>.
124106

125107
</Alert>
126108

0 commit comments

Comments
 (0)