-
-
Notifications
You must be signed in to change notification settings - Fork 353
feat(replay): Add screenshotStrategy option for Android #5301
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
base: main
Are you sure you want to change the base?
Conversation
|
Android (legacy) Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 3bd3f0d+dirty | 447.21 ms | 472.31 ms | 25.10 ms |
| 46da307 | 455.92 ms | 443.79 ms | -12.13 ms |
| 083f560+dirty | 358.21 ms | 382.00 ms | 23.79 ms |
| 59f3a84+dirty | 382.16 ms | 376.45 ms | -5.71 ms |
| 69602ce | 417.47 ms | 443.52 ms | 26.05 ms |
| 5526494 | 440.84 ms | 448.36 ms | 7.52 ms |
| 6a70a7e+dirty | 381.72 ms | 413.94 ms | 32.22 ms |
| 77061ed+dirty | 369.55 ms | 408.35 ms | 38.80 ms |
| 07808fb+dirty | 419.10 ms | 419.08 ms | -0.02 ms |
| 000da7a | 454.46 ms | 445.00 ms | -9.46 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 3bd3f0d+dirty | 17.75 MiB | 19.70 MiB | 1.95 MiB |
| 46da307 | 17.75 MiB | 19.68 MiB | 1.93 MiB |
| 083f560+dirty | 17.75 MiB | 19.70 MiB | 1.96 MiB |
| 59f3a84+dirty | 17.75 MiB | 19.70 MiB | 1.95 MiB |
| 69602ce | 17.75 MiB | 19.68 MiB | 1.94 MiB |
| 5526494 | 17.75 MiB | 19.68 MiB | 1.93 MiB |
| 6a70a7e+dirty | 17.75 MiB | 19.69 MiB | 1.94 MiB |
| 77061ed+dirty | 17.75 MiB | 19.68 MiB | 1.94 MiB |
| 07808fb+dirty | 17.75 MiB | 19.70 MiB | 1.95 MiB |
| 000da7a | 17.75 MiB | 19.68 MiB | 1.94 MiB |
Android (new) Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 3bd3f0d+dirty | 334.38 ms | 402.19 ms | 67.81 ms |
| 083f560+dirty | 383.96 ms | 417.76 ms | 33.80 ms |
| 59f3a84+dirty | 359.69 ms | 407.54 ms | 47.86 ms |
| 6a70a7e+dirty | 382.45 ms | 424.54 ms | 42.09 ms |
| 77061ed+dirty | 359.40 ms | 424.10 ms | 64.70 ms |
| 07808fb+dirty | 392.47 ms | 451.94 ms | 59.47 ms |
| 000da7a+dirty | 347.89 ms | 381.98 ms | 34.09 ms |
| 785ffb1+dirty | 380.65 ms | 451.83 ms | 71.18 ms |
| 90afdd3+dirty | 367.79 ms | 404.84 ms | 37.05 ms |
| c1573b3+dirty | 355.65 ms | 448.82 ms | 93.17 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 3bd3f0d+dirty | 7.15 MiB | 8.43 MiB | 1.28 MiB |
| 083f560+dirty | 7.15 MiB | 8.43 MiB | 1.28 MiB |
| 59f3a84+dirty | 7.15 MiB | 8.43 MiB | 1.28 MiB |
| 6a70a7e+dirty | 7.15 MiB | 8.42 MiB | 1.26 MiB |
| 77061ed+dirty | 7.15 MiB | 8.41 MiB | 1.26 MiB |
| 07808fb+dirty | 7.15 MiB | 8.43 MiB | 1.28 MiB |
| 000da7a+dirty | 7.15 MiB | 8.41 MiB | 1.26 MiB |
| 785ffb1+dirty | 7.15 MiB | 8.42 MiB | 1.27 MiB |
| 90afdd3+dirty | 7.15 MiB | 8.43 MiB | 1.28 MiB |
| c1573b3+dirty | 7.15 MiB | 8.42 MiB | 1.27 MiB |
iOS (legacy) Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 90edad7+dirty | 1222.08 ms | 1228.40 ms | 6.32 ms |
| 20d5eaa+dirty | 1231.12 ms | 1226.00 ms | -5.12 ms |
| 8490686+dirty | 1227.84 ms | 1228.91 ms | 1.08 ms |
| f70acbf+dirty | 1235.71 ms | 1243.14 ms | 7.43 ms |
| 5ee3314+dirty | 1215.18 ms | 1207.64 ms | -7.54 ms |
| 98f632c+dirty | 1236.40 ms | 1241.62 ms | 5.22 ms |
| bc9680d+dirty | 1221.41 ms | 1241.47 ms | 20.06 ms |
| 3099014+dirty | 1226.75 ms | 1236.56 ms | 9.81 ms |
| a31630c+dirty | 1229.09 ms | 1230.94 ms | 1.85 ms |
| 8db9631+dirty | 1223.60 ms | 1224.56 ms | 0.96 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 90edad7+dirty | 2.63 MiB | 4.00 MiB | 1.36 MiB |
| 20d5eaa+dirty | 2.63 MiB | 3.81 MiB | 1.18 MiB |
| 8490686+dirty | 2.63 MiB | 4.00 MiB | 1.36 MiB |
| f70acbf+dirty | 2.63 MiB | 3.98 MiB | 1.34 MiB |
| 5ee3314+dirty | 2.63 MiB | 3.99 MiB | 1.35 MiB |
| 98f632c+dirty | 2.63 MiB | 3.81 MiB | 1.18 MiB |
| bc9680d+dirty | 2.63 MiB | 3.81 MiB | 1.18 MiB |
| 3099014+dirty | 2.63 MiB | 3.98 MiB | 1.35 MiB |
| a31630c+dirty | 2.63 MiB | 3.98 MiB | 1.34 MiB |
| 8db9631+dirty | 2.63 MiB | 4.00 MiB | 1.36 MiB |
iOS (new) Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 90edad7+dirty | 1235.21 ms | 1241.45 ms | 6.24 ms |
| 20d5eaa+dirty | 1224.67 ms | 1223.16 ms | -1.51 ms |
| 8490686+dirty | 1227.32 ms | 1240.82 ms | 13.50 ms |
| f70acbf+dirty | 1239.00 ms | 1242.53 ms | 3.53 ms |
| 5ee3314+dirty | 1234.25 ms | 1235.44 ms | 1.19 ms |
| 98f632c+dirty | 1221.38 ms | 1229.26 ms | 7.88 ms |
| bc9680d+dirty | 1228.57 ms | 1233.64 ms | 5.07 ms |
| 3099014+dirty | 1234.04 ms | 1243.22 ms | 9.18 ms |
| a31630c+dirty | 1241.32 ms | 1226.98 ms | -14.34 ms |
| 8db9631+dirty | 1226.92 ms | 1226.06 ms | -0.85 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 90edad7+dirty | 3.19 MiB | 4.56 MiB | 1.38 MiB |
| 20d5eaa+dirty | 3.19 MiB | 4.38 MiB | 1.19 MiB |
| 8490686+dirty | 3.19 MiB | 4.56 MiB | 1.38 MiB |
| f70acbf+dirty | 3.19 MiB | 4.54 MiB | 1.36 MiB |
| 5ee3314+dirty | 3.19 MiB | 4.55 MiB | 1.37 MiB |
| 98f632c+dirty | 3.19 MiB | 4.38 MiB | 1.19 MiB |
| bc9680d+dirty | 3.19 MiB | 4.38 MiB | 1.19 MiB |
| 3099014+dirty | 3.19 MiB | 4.55 MiB | 1.36 MiB |
| a31630c+dirty | 3.19 MiB | 4.54 MiB | 1.36 MiB |
| 8db9631+dirty | 3.19 MiB | 4.56 MiB | 1.38 MiB |
| * - Experiment: In case you are noticing issues with the canvas screenshot strategy, please report the issue on [GitHub](https://github.com/getsentry/sentry-java). | ||
| * | ||
| * @default 'pixelCopy' | ||
| * @platform android |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that's a good idea 👍
| enableExperimentalViewRenderer: false, | ||
| enableViewRendererV2: true, | ||
| enableFastViewRendering: false, | ||
| screenshotStrategy: 'pixelCopy', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might be worth on a major change to default it to canvas if sendDefaultPii is not true.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah we'll monitor the adoption and possibly make it a default in the future
| return ScreenshotStrategyType.PIXEL_COPY; | ||
| } | ||
|
|
||
| try { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
q: why the try/catch block here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just followed the pattern for quality, but can remove it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't recall why I added the try/catch block for quality 😓
I probably followed an existing pattern or modified the code from a state that it was needed. I think it is not needed and opened #5305 to fix that.
packages/core/android/src/main/java/io/sentry/react/RNSentryModuleImpl.java
Show resolved
Hide resolved
|
Thank you for the PR! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀
Thank you for adding this Roman 🙇
| try { | ||
| switch (strategyString.toLowerCase(Locale.ROOT)) { | ||
| case "canvas": | ||
| return ScreenshotStrategyType.CANVAS; | ||
| default: | ||
| return ScreenshotStrategyType.PIXEL_COPY; | ||
| } | ||
| } catch (Exception e) { | ||
| return ScreenshotStrategyType.PIXEL_COPY; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Following up on https://github.com/getsentry/sentry-react-native/pull/5301/files#r2461084612
| try { | |
| switch (strategyString.toLowerCase(Locale.ROOT)) { | |
| case "canvas": | |
| return ScreenshotStrategyType.CANVAS; | |
| default: | |
| return ScreenshotStrategyType.PIXEL_COPY; | |
| } | |
| } catch (Exception e) { | |
| return ScreenshotStrategyType.PIXEL_COPY; | |
| } | |
| switch (strategyString.toLowerCase(Locale.ROOT)) { | |
| case "canvas": | |
| return ScreenshotStrategyType.CANVAS; | |
| default: | |
| return ScreenshotStrategyType.PIXEL_COPY; | |
| } |
📢 Type of change
📜 Description
Adds new
screenshotStrategyoption which only applies to Android targets. Here's a docs PR for Android which explains both strategies better.An example replay from the sample app: https://sentry-sdks.sentry.io/explore/replays/33ea588853ad4d0fa070424728b3f701/
💡 Motivation and Context
Better masking
Closes #5300
💚 How did you test it?
Sample app + we extensively tested it with BlueSky
📝 Checklist
sendDefaultPIIis enabled🔮 Next steps
Add docs