Skip to content

Commit 5366f68

Browse files
authored
Troubleshoot android minified libraries autoinstrumentation (#12106)
* changed Android TTFD timeout from 30 to 25 seconds * added gradle plugin auto-instrumentation issue with minified libraries to troubleshooting page
1 parent 01e53e3 commit 5366f68

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

docs/platforms/android/tracing/instrumentation/automatic-instrumentation.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,5 +443,5 @@ Sentry.reportFullyDisplayed()
443443

444444
Time to full display is dependent on having an active transaction bound to the scope. Ideally, it should be used along with [Activity Instrumentation](/platforms/android/tracing/instrumentation/automatic-instrumentation/#activity-instrumentation), which starts a transaction and binds it to the scope automatically.
445445

446-
If the span finishes through the API, its `status` is set to `SpanStatus.OK`. If the span doesn't finish after 30 seconds, it is finished by the SDK automatically, and its `status` is set to `SpanStatus.DEADLINE_EXCEEDED`.
446+
If the span finishes through the API, its `status` is set to `SpanStatus.OK`. If the span doesn't finish after 25 seconds, it is finished by the SDK automatically, and its `status` is set to `SpanStatus.DEADLINE_EXCEEDED`.
447447
If the span finishes before the Activity is first drawn and displayed as measured by the `Time to initial display`, the reported time will be shifted to `Time to initial display` measured time.

docs/platforms/android/troubleshooting/index.mdx

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,27 @@ With this information, it might be more clear what's happening. If not, please c
194194

195195
The [Sentry Android Gradle plugin](/platforms/android/configuration/gradle/) uses bytecode manipulation to automatically measure the performance of your application. This process requires looking at the dependencies of the application, which can potentially break the build process if there are libraries which have been compiled/minified with a non-default java compiler, like R8/D8.
196196

197-
The culprit is usually our [File I/O instrumentation](/platforms/android/integrations/file-io/), which can be disabled as follows:
197+
If you experience a "[sentry] Error while instrumenting MyClassName" error message, it could be that you are using a minified library that cannot be instrumented, as the bytecode is not compliant with the JVM spec. You can exclude such library from instrumentation as follows:
198+
199+
```groovy
200+
sentry {
201+
tracingInstrumentation {
202+
enabled = true
203+
excludes = ['com/example/donotinstrument/**']
204+
}
205+
}
206+
```
207+
208+
```kotlin
209+
sentry {
210+
tracingInstrumentation {
211+
enabled.set(true)
212+
excludes.set(setOf("com/example/donotinstrument/**"))
213+
}
214+
}
215+
```
216+
217+
You may also disable one of our instrumentations, like our [File I/O instrumentation](/platforms/android/integrations/file-io/), which is usually the culprit, as follows:
198218

199219
```groovy
200220
import io.sentry.android.gradle.extensions.InstrumentationFeature

0 commit comments

Comments
 (0)