Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Android): Integrate source context into Android Gradle overview page #7100

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions src/platforms/android/common/gradle.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ The [Sentry Android Gradle Plugin](https://github.com/getsentry/sentry-android-g
seamless integration with the Gradle build system. It supports the following features:

- ProGuard/R8 mappings upload
- Java/Kotlin Source Context upload
- Native debug symbols and sources upload
- Auto-instrumentation tracing through bytecode manipulation
- Logcat breadcrumb logging
Expand Down Expand Up @@ -85,6 +86,11 @@ sentry {
// Default is disabled.
uploadNativeSymbols = false

// Generates a source bundle and uploads your source code to Sentry.
// This enables source context, allowing you to see your source
// code as part of your stack traces in Sentry.
includeSourceContext = false

// Does or doesn't include the source code of native code for Sentry.
// This executes sentry-cli with the --include-sources param. automatically so
// you don't need to do it manually.
Expand Down Expand Up @@ -168,6 +174,11 @@ sentry {
// Default is disabled.
uploadNativeSymbols.set(false)

// Generates a source bundle and uploads your source code to Sentry.
// This enables source context, allowing you to see your source
// code as part of your stack traces in Sentry.
includeSourceContext.set(false)

// Does or doesn't include the source code of native code for Sentry.
// This executes sentry-cli with the --include-sources param. automatically so
// you don't need to do it manually.
Expand Down Expand Up @@ -288,6 +299,24 @@ You can find your authentication token [on the Sentry API page](https://sentry.i

</Note>

## Java/Kotlin Source Context

The plugin can automatically upload your source code to Sentry so it can be shown as part of the stacktraces.

```groovy
sentry {
includeSourceContext = true
}
```

```kotlin
sentry {
includeSourceContext.set(true)
}
```

Checkout the full documentation on <PlatformLink to="/source-context">Source Context</PlatformLink> for more details.

## Tracing Auto-instrumentation

The plugin uses the [bytecode manipulation](https://www.infoq.com/articles/Living-Matrix-Bytecode-Manipulation/) framework to inject a code snippet
Expand Down