Title: Add automatic Navigation 3 instrumentation to the Sentry Android Gradle Plugin · Issue #6349 · getsentry/sentry-java · GitHub
Open Graph Title: Add automatic Navigation 3 instrumentation to the Sentry Android Gradle Plugin · Issue #6349 · getsentry/sentry-java
X Title: Add automatic Navigation 3 instrumentation to the Sentry Android Gradle Plugin · Issue #6349 · getsentry/sentry-java
Description: Add automatic Navigation 3 instrumentation to the Sentry Android Gradle Plugin Summary Add Sentry Android Gradle Plugin support for automatically instrumenting Jetpack Navigation 3 applications. Today, Nav3 users must manually: Call Sent...
Open Graph Description: Add automatic Navigation 3 instrumentation to the Sentry Android Gradle Plugin Summary Add Sentry Android Gradle Plugin support for automatically instrumenting Jetpack Navigation 3 applications. To...
X Description: Add automatic Navigation 3 instrumentation to the Sentry Android Gradle Plugin Summary Add Sentry Android Gradle Plugin support for automatically instrumenting Jetpack Navigation 3 applications. To...
Opengraph URL: https://github.com/getsentry/sentry-java/issues/6349
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Add automatic Navigation 3 instrumentation to the Sentry Android Gradle Plugin","articleBody":"# Add automatic Navigation 3 instrumentation to the Sentry Android Gradle Plugin\n\n## Summary\n\nAdd Sentry Android Gradle Plugin support for automatically instrumenting Jetpack Navigation 3 applications.\n\nToday, Nav3 users must manually:\n\n1. Call `SentryNavEffect` alongside `NavDisplay`.\n2. Provide a `BackStackEntryMapper` for their entire back stack.\n\nThis creates significant setup overhead and makes Nav3 instrumentation less discoverable than Nav2 instrumentation.\n\nThe SDK-side APIs and default mappers needed for this work are being introduced in [sentry-java#6273](https://github.com/getsentry/sentry-java/pull/6273).\n\n## Proposed approach\n\nInstrument the internal `rememberDecoratedNavEntries()` call used by `NavDisplay`.\n\nThis appears preferable to instrumenting callers of `NavDisplay` because:\n\n- The internal function has remained stable across Nav3 releases so far.\n- The hook provides a precise and efficient instrumentation point.\n- ASM does not need to scan arbitrary application code or handle all `NavDisplay` overloads.\n- The approach should work across the existing Nav3 API variations.\n\nThe transformed code should install the SDK’s `SentryNavAutoInstrumentation.Effect` and configure it with the appropriate back-stack mapping behavior.\n\n## Back-stack entry mapping\n\nAutomatic instrumentation should use the SDK-provided default mapping behavior:\n\n- Prefer the kotlinx.serialization `@SerialName` for `NavKey` types.\n- Include serialized arguments where supported.\n- Fall back to `/unknown` when a stable serial name cannot be determined.\n- Preserve the ability for manually configured `SentryNavEffect` users to provide custom mappers.\n\nThe implementation should account for R8/minification. Serial names are compile-time constants and should remain available without requiring broad keep rules.\n\n## Configuration and privacy\n\nDetermine how automatic instrumentation should select the mapping behavior:\n\n- Use the `BackStackMappingType` exposed by `SentryNavAutoInstrumentation`.\n- Decide whether configuration belongs in `SentryOptions`, an Android manifest option, or both.\n- Ensure serialized arguments follow the same sanitization and data-collection rules as the SDK-side implementation.\n- Document how users can disable argument collection or automatic Nav3 instrumentation if needed.\n\n## Compatibility and safety\n\nThe implementation should:\n\n- Support the currently supported Nav3 versions and define the compatibility policy for future versions.\n- Avoid double instrumentation when an application already uses `SentryNavEffect`.\n- Avoid conflicts when multiple `NavDisplay`/`SentryNavEffect` pairs are active.\n- Clearly document unsupported combinations, including Nav2 and Nav3 instrumentation being active in the same application.\n- Include canary coverage against representative Nav3 applications and API versions.\n- Verify behavior in minified builds.\n\n## Acceptance criteria\n\n- A Nav3 application receives navigation transactions, breadcrumbs, screen names, and back-stack context without manually calling `SentryNavEffect`.\n- No manually implemented `BackStackEntryMapper` is required for the common `@Serializable NavKey` case.\n- Existing manually configured Nav3 integrations continue to work unchanged.\n- Automatic instrumentation can be disabled.\n- Duplicate instrumentation is prevented or safely detected.\n- Tests cover bytecode transformation, runtime behavior, minification, supported Nav3 versions, and failure/fallback cases.\n- The Nav3 documentation explains automatic instrumentation, configuration, limitations, and manual setup.\n\n## References\n\n- [sentry-java#6273](https://github.com/getsentry/sentry-java/pull/6273)\n- [Jetpack Navigation 3 documentation](https://developer.android.com/guide/navigation/navigation-3)\n- Proposed instrumentation hook: `rememberDecoratedNavEntries()` inside `NavDisplay`\n","author":{"url":"https://github.com/0xadam-brown","@type":"Person","name":"0xadam-brown"},"datePublished":"2026-10-21T13:29:55Z","url":"https://github.com/getsentry/sentry-java/issues/6349"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:09258381-8821-9648-9f27-7f36f65a3964 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AFD4:17F930:18D14A:225A00:6B0465EA |
| html-safe-nonce | 48b34699c58c961a4abd17afcd300cd0230907281d47d4a9ecc353d020ad767f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRkQ0OjE3RjkzMDoxOEQxNEE6MjI1QTAwOjZCMDQ2NUVBIiwidmlzaXRvcl9pZCI6IjMxNjU1Nzk5NzE5OTc3NTQ4NTgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | ac5ab38dc0973ac050309cce0506ebe8aa51ea433f179d6ec5e1d8a68bc5460c |
| hovercard-subject-tag | issue:5961492810 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-java/6349/issue_layout |
| twitter:image | https://opengraph.githubassets.com/807991886b273ea7ecb30be26f7abf456970810c85255b5042c7596a672ab29f/getsentry/sentry-java/issues/6349 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/807991886b273ea7ecb30be26f7abf456970810c85255b5042c7596a672ab29f/getsentry/sentry-java/issues/6349 |
| og:image:alt | Add automatic Navigation 3 instrumentation to the Sentry Android Gradle Plugin Summary Add Sentry Android Gradle Plugin support for automatically instrumenting Jetpack Navigation 3 applications. To... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | 0xadam-brown |
| hostname | github.com |
| expected-hostname | github.com |
| None | 83e4c0e58c5162177f3c161c5fbad38527ae04c11ac14980f9f9d85ae2027b1f |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-java git https://github.com/getsentry/sentry-java.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 3368190 |
| octolytics-dimension-repository_nwo | getsentry/sentry-java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3368190 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-java |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | ca4d07a7cef4e4b75f821dc25e7300d80c1450a9 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width