Add automatic Navigation 3 instrumentation to the Sentry Android Gradle Plugin
Maintainer thường phản hồi trong vòng 1 ngày
@0xadam-brown đang làm issue này rồi.
Từ ngày 21/10/2026.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
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
SentryNavEffectalongsideNavDisplay. - Provide a
BackStackEntryMapperfor their entire back stack.
This creates significant setup overhead and makes Nav3 instrumentation less discoverable than Nav2 instrumentation.
The SDK-side APIs and default mappers needed for this work are being introduced in sentry-java#6273.
Proposed approach
Instrument the internal rememberDecoratedNavEntries() call used by NavDisplay.
This appears preferable to instrumenting callers of NavDisplay because:
- The internal function has remained stable across Nav3 releases so far.
- The hook provides a precise and efficient instrumentation point.
- ASM does not need to scan arbitrary application code or handle all
NavDisplayoverloads. - The approach should work across the existing Nav3 API variations.
The transformed code should install the SDK’s SentryNavAutoInstrumentation.Effect and configure it with the appropriate back-stack mapping behavior.
Back-stack entry mapping
Automatic instrumentation should use the SDK-provided default mapping behavior:
- Prefer the kotlinx.serialization
@SerialNameforNavKeytypes. - Include serialized arguments where supported.
- Fall back to
/unknownwhen a stable serial name cannot be determined. - Preserve the ability for manually configured
SentryNavEffectusers to provide custom mappers.
The implementation should account for R8/minification. Serial names are compile-time constants and should remain available without requiring broad keep rules.
Configuration and privacy
Determine how automatic instrumentation should select the mapping behavior:
- Use the
BackStackMappingTypeexposed bySentryNavAutoInstrumentation. - Decide whether configuration belongs in
SentryOptions, an Android manifest option, or both. - Ensure serialized arguments follow the same sanitization and data-collection rules as the SDK-side implementation.
- Document how users can disable argument collection or automatic Nav3 instrumentation if needed.
Compatibility and safety
The implementation should:
- Support the currently supported Nav3 versions and define the compatibility policy for future versions.
- Avoid double instrumentation when an application already uses
SentryNavEffect. - Avoid conflicts when multiple
NavDisplay/SentryNavEffectpairs are active. - Clearly document unsupported combinations, including Nav2 and Nav3 instrumentation being active in the same application.
- Include canary coverage against representative Nav3 applications and API versions.
- Verify behavior in minified builds.
Acceptance criteria
- A Nav3 application receives navigation transactions, breadcrumbs, screen names, and back-stack context without manually calling
SentryNavEffect. - No manually implemented
BackStackEntryMapperis required for the common@Serializable NavKeycase. - Existing manually configured Nav3 integrations continue to work unchanged.
- Automatic instrumentation can be disabled.
- Duplicate instrumentation is prevented or safely detected.
- Tests cover bytecode transformation, runtime behavior, minification, supported Nav3 versions, and failure/fallback cases.
- The Nav3 documentation explains automatic instrumentation, configuration, limitations, and manual setup.
References
- sentry-java#6273
- Jetpack Navigation 3 documentation
- Proposed instrumentation hook:
rememberDecoratedNavEntries()insideNavDisplay
- Ngôn ngữ chính
- Kotlin
- Star
- 1.4k
- Fork
- 483
- Merge trung bình
- 2 ngày 54 phút
- Pull request đã merge (30 ngày)
- 207
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của getsentry/sentry-java
-
Test the `sentry wizard` Android portCó thể đã có người làm @antonis đã nhận 1 ngày trước. Đang mởPlatform: Java
getsentry/sentry-java#6797 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Narrow and clean up Android consumer keep rulesCó thể đã có người làm @runningcode đã nhận 3 ngày trước. Đang mởAndroid Platform: Java
getsentry/sentry-java#6771 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Android Bug Platform: Java Waiting for: Product Owner
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
getsentry/sentry-java#6758 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Android Bug Platform: Java Replays
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 62/100
getsentry/sentry-java#6741 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Android Bug Platform: Java Replays
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 50/100
getsentry/sentry-java#6740 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của getsentry/sentry-java
Issue tương tự
-
[BUG] Issue reported from ReFraĐang mởenhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
IacobIonut01/ReFra#1515 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 4 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
openwatersio/slackwater-android#162 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 72/100
developmentwithyash/yaan#184 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
analytics
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
-
🐛 Type:Bug 📏 Size: S 🔧 State:In Progress 🔹 Priority: P2 - Medium
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
yeliqin666/xjtu-toolbox-android#623 · 1 bình luận ·