fix(replay): Allow excluding the sentry-android-replay module from android targets#5174
Merged
fix(replay): Allow excluding the sentry-android-replay module from android targets#5174
Conversation
packages/core/android/src/main/java/io/sentry/react/RNSentryModuleImpl.java
Show resolved
Hide resolved
Contributor
iOS (legacy) Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 785ffb1+dirty | 1237.63 ms | 1240.50 ms | 2.87 ms |
| 95aaf8a+dirty | 1234.78 ms | 1241.94 ms | 7.16 ms |
| c08359e+dirty | 1235.25 ms | 1233.96 ms | -1.29 ms |
| c1573b3+dirty | 1203.33 ms | 1202.47 ms | -0.86 ms |
| 7be1f99+dirty | 1226.69 ms | 1217.76 ms | -8.93 ms |
| ba75c7c+dirty | 1235.86 ms | 1226.45 ms | -9.41 ms |
| 1853710+dirty | 1224.35 ms | 1230.18 ms | 5.84 ms |
| 534ba8c+dirty | 1230.22 ms | 1231.18 ms | 0.96 ms |
| af9331b+dirty | 1233.61 ms | 1230.50 ms | -3.11 ms |
| c9e95bd+dirty | 1240.19 ms | 1246.33 ms | 6.14 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 785ffb1+dirty | 2.63 MiB | 3.81 MiB | 1.18 MiB |
| 95aaf8a+dirty | 2.63 MiB | 3.87 MiB | 1.24 MiB |
| c08359e+dirty | 2.63 MiB | 3.81 MiB | 1.18 MiB |
| c1573b3+dirty | 2.63 MiB | 3.81 MiB | 1.18 MiB |
| 7be1f99+dirty | 2.63 MiB | 3.81 MiB | 1.18 MiB |
| ba75c7c+dirty | 2.63 MiB | 3.81 MiB | 1.18 MiB |
| 1853710+dirty | 2.63 MiB | 3.91 MiB | 1.28 MiB |
| 534ba8c+dirty | 2.63 MiB | 3.81 MiB | 1.18 MiB |
| af9331b+dirty | 2.63 MiB | 3.91 MiB | 1.28 MiB |
| c9e95bd+dirty | 2.63 MiB | 3.87 MiB | 1.24 MiB |
Contributor
iOS (new) Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 785ffb1+dirty | 1213.71 ms | 1213.37 ms | -0.35 ms |
| 95aaf8a+dirty | 1206.83 ms | 1213.65 ms | 6.81 ms |
| c08359e+dirty | 1200.59 ms | 1211.81 ms | 11.22 ms |
| c1573b3+dirty | 1245.69 ms | 1245.48 ms | -0.21 ms |
| 7be1f99+dirty | 1222.43 ms | 1217.15 ms | -5.28 ms |
| ba75c7c+dirty | 1236.14 ms | 1240.69 ms | 4.55 ms |
| 1853710+dirty | 1213.67 ms | 1226.35 ms | 12.67 ms |
| 534ba8c+dirty | 1225.00 ms | 1237.43 ms | 12.43 ms |
| af9331b+dirty | 1230.08 ms | 1233.24 ms | 3.16 ms |
| c9e95bd+dirty | 1205.83 ms | 1207.38 ms | 1.55 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 785ffb1+dirty | 3.19 MiB | 4.38 MiB | 1.19 MiB |
| 95aaf8a+dirty | 3.19 MiB | 4.44 MiB | 1.25 MiB |
| c08359e+dirty | 3.19 MiB | 4.38 MiB | 1.19 MiB |
| c1573b3+dirty | 3.19 MiB | 4.38 MiB | 1.19 MiB |
| 7be1f99+dirty | 3.19 MiB | 4.38 MiB | 1.19 MiB |
| ba75c7c+dirty | 3.19 MiB | 4.38 MiB | 1.19 MiB |
| 1853710+dirty | 3.19 MiB | 4.48 MiB | 1.29 MiB |
| 534ba8c+dirty | 3.19 MiB | 4.38 MiB | 1.19 MiB |
| af9331b+dirty | 3.19 MiB | 4.48 MiB | 1.29 MiB |
| c9e95bd+dirty | 3.19 MiB | 4.44 MiB | 1.25 MiB |
Contributor
Android (legacy) Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| eb07ba3 | 470.04 ms | 473.35 ms | 3.31 ms |
| ba75c7c | 367.72 ms | 369.16 ms | 1.44 ms |
| 3e0a5f9 | 401.72 ms | 394.98 ms | -6.74 ms |
| 1853710 | 555.47 ms | 556.59 ms | 1.12 ms |
| 46bd012 | 387.09 ms | 404.47 ms | 17.38 ms |
| c4e097a | 338.06 ms | 439.36 ms | 101.30 ms |
| e2fa43d | 451.68 ms | 462.42 ms | 10.74 ms |
| 64cd15c | 439.02 ms | 427.63 ms | -11.39 ms |
| d916aa3 | 425.37 ms | 427.02 ms | 1.65 ms |
| a0b15d6 | 423.06 ms | 437.77 ms | 14.71 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| eb07ba3 | 17.75 MiB | 20.15 MiB | 2.41 MiB |
| ba75c7c | 17.75 MiB | 20.15 MiB | 2.41 MiB |
| 3e0a5f9 | 17.75 MiB | 20.15 MiB | 2.41 MiB |
| 1853710 | 17.75 MiB | 19.68 MiB | 1.94 MiB |
| 46bd012 | 17.75 MiB | 20.15 MiB | 2.41 MiB |
| c4e097a | 17.75 MiB | 19.68 MiB | 1.94 MiB |
| e2fa43d | 17.75 MiB | 20.15 MiB | 2.41 MiB |
| 64cd15c | 17.75 MiB | 20.15 MiB | 2.41 MiB |
| d916aa3 | 17.75 MiB | 20.15 MiB | 2.41 MiB |
| a0b15d6 | 17.75 MiB | 20.15 MiB | 2.41 MiB |
Contributor
Android (new) Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 7be1f99+dirty | 369.02 ms | 399.60 ms | 30.58 ms |
| 3e0a5f9+dirty | 379.92 ms | 450.96 ms | 71.04 ms |
| e2fa43d+dirty | 326.56 ms | 372.88 ms | 46.32 ms |
| 8a4ce6f+dirty | 401.11 ms | 381.92 ms | -19.19 ms |
| 000da7a+dirty | 347.89 ms | 381.98 ms | 34.09 ms |
| 785ffb1+dirty | 380.65 ms | 451.83 ms | 71.18 ms |
| c9e95bd+dirty | 339.32 ms | 401.24 ms | 61.92 ms |
| 8ece263+dirty | 369.44 ms | 414.65 ms | 45.21 ms |
| bc9680d+dirty | 346.77 ms | 463.48 ms | 116.71 ms |
| b3b5b0d+dirty | 361.42 ms | 403.90 ms | 42.48 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 7be1f99+dirty | 7.15 MiB | 8.42 MiB | 1.27 MiB |
| 3e0a5f9+dirty | 7.15 MiB | 8.42 MiB | 1.27 MiB |
| e2fa43d+dirty | 7.15 MiB | 8.42 MiB | 1.27 MiB |
| 8a4ce6f+dirty | 7.15 MiB | 8.41 MiB | 1.26 MiB |
| 000da7a+dirty | 7.15 MiB | 8.41 MiB | 1.26 MiB |
| 785ffb1+dirty | 7.15 MiB | 8.42 MiB | 1.27 MiB |
| c9e95bd+dirty | 7.15 MiB | 8.41 MiB | 1.26 MiB |
| 8ece263+dirty | 7.15 MiB | 8.41 MiB | 1.26 MiB |
| bc9680d+dirty | 7.15 MiB | 8.42 MiB | 1.27 MiB |
| b3b5b0d+dirty | 7.15 MiB | 8.41 MiB | 1.26 MiB |
|
|
||
| ### Fixes | ||
|
|
||
| - Session Replay: Allow excluding `sentry-android-replay` from android targets ([#5174](https://github.com/getsentry/sentry-react-native/pull/5174)) |
Collaborator
There was a problem hiding this comment.
It would be nice to include a simple mention on how to remove it with a sample diff
Collaborator
There was a problem hiding this comment.
Example of what we did for Web Replay: https://github.com/getsentry/sentry-react-native/blob/cf745081e2928fd7b1459e38989d54d8ef0815b9/CHANGELOG.md#features-25
And with that, it's optional, but we could also include an estimation on how much app size is reduced when users opt out for mobile replay.
6 tasks
antonis
added a commit
to getsentry/sentry-docs
that referenced
this pull request
Sep 17, 2025
…from android targets (#14963) <!-- Use this checklist to make sure your PR is ready for merge. You may delete any sections you don't need. --> ## DESCRIBE YOUR PR *Tell us what you're changing and why. If your PR **resolves an issue**, please link it so it closes automatically.* Adds instructions for excluding the sentry-android-replay module from android targets ## IS YOUR CHANGE URGENT? Help us prioritize incoming PRs by letting us know when the change needs to go live. - [ ] Urgent deadline (GA date, etc.): <!-- ENTER DATE HERE --> - [ ] Other deadline: <!-- ENTER DATE HERE --> - [ ] None: Not urgent, can wait up to 1 week+ The related PR getsentry/sentry-react-native#5174 has been released in https://github.com/getsentry/sentry-react-native/releases/tag/7.1.0 ## SLA - Teamwork makes the dream work, so please add a reviewer to your PRs. - Please give the docs team up to 1 week to review your PR unless you've added an urgent due date to it. Thanks in advance for your help! ## PRE-MERGE CHECKLIST *Make sure you've checked the following before merging your changes:* - [ ] Checked Vercel preview for correctness, including links - [ ] PR was reviewed and approved by any necessary SMEs (subject matter experts) - [ ] PR was reviewed and approved by a member of the [Sentry docs team](https://github.com/orgs/getsentry/teams/docs) ## LEGAL BOILERPLATE <!-- Sentry employees and contractors can delete or ignore this section. --> Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms. ## EXTRA RESOURCES - [Sentry Docs contributor guide](https://docs.sentry.io/contributing/)
10 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📢 Type of change
📜 Description
replay-stubsunder the android target. This allows customers to excludesentry-android-replayif they are not interested in replay and save some bundle sizeupdate-depsworkflow to bump the current sentry version which the stubs are compiled againstyarn build(via./gradlew jar) and checked into git so the android target can use itREADME.mdof the respective moduleHere's an example replay after the changes: https://sentry-sdks.sentry.io/explore/replays/f0a8d20f73d54ea4b553901edeb83c50/
💡 Motivation and Context
Closes getsentry/sentry-java#4718
Closes ANDROID-197
💚 How did you test it?
Only manually tested for now, there's no really a good way to automatically test it without setting up gradle testkit which seems like a lot of work for little benefit (considering this is not a default behavior and likely rarely needed).
📝 Checklist
sendDefaultPIIis enabled🔮 Next steps