Skip to content

Conversation

@romtsn
Copy link
Member

@romtsn romtsn commented Oct 23, 2025

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

📜 Description

Adds new screenshotStrategy option 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

  • I added tests to verify changes
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • All tests passing
  • No breaking changes

🔮 Next steps

Add docs

@github-actions
Copy link
Contributor

github-actions bot commented Oct 23, 2025

Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against aef23db

@github-actions
Copy link
Contributor

github-actions bot commented Oct 23, 2025

Android (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 341.76 ms 353.04 ms 11.28 ms
Size 17.75 MiB 19.74 MiB 1.99 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
f234eb4+dirty 407.62 ms 429.64 ms 22.02 ms
5c16cdc+dirty 423.48 ms 452.35 ms 28.88 ms
69602ce 417.47 ms 443.52 ms 26.05 ms
46bd012 387.09 ms 404.47 ms 17.38 ms
d916aa3 425.37 ms 427.02 ms 1.65 ms
276d348+dirty 375.48 ms 403.76 ms 28.28 ms
49ef936+dirty 405.96 ms 417.22 ms 11.26 ms
6479fd5+dirty 412.95 ms 434.02 ms 21.07 ms
0b64753+dirty 448.67 ms 474.61 ms 25.94 ms
88890fe+dirty 350.94 ms 365.74 ms 14.80 ms

App size

Revision Plain With Sentry Diff
f234eb4+dirty 17.75 MiB 19.74 MiB 1.99 MiB
5c16cdc+dirty 17.75 MiB 19.68 MiB 1.94 MiB
69602ce 17.75 MiB 19.68 MiB 1.94 MiB
46bd012 17.75 MiB 20.15 MiB 2.41 MiB
d916aa3 17.75 MiB 20.15 MiB 2.41 MiB
276d348+dirty 17.75 MiB 19.69 MiB 1.94 MiB
49ef936+dirty 17.75 MiB 19.69 MiB 1.94 MiB
6479fd5+dirty 17.75 MiB 19.68 MiB 1.94 MiB
0b64753+dirty 17.75 MiB 19.70 MiB 1.95 MiB
88890fe+dirty 17.75 MiB 19.71 MiB 1.96 MiB

Previous results on branch: rz/feat/screenshot-strategy-option

Startup times

Revision Plain With Sentry Diff
ab6c522+dirty 383.54 ms 442.32 ms 58.78 ms

App size

Revision Plain With Sentry Diff
ab6c522+dirty 17.75 MiB 19.74 MiB 1.99 MiB

@github-actions
Copy link
Contributor

github-actions bot commented Oct 23, 2025

Android (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 318.19 ms 318.33 ms 0.13 ms
Size 7.15 MiB 8.46 MiB 1.30 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
f234eb4+dirty 313.23 ms 333.31 ms 20.08 ms
5c16cdc+dirty 375.45 ms 426.62 ms 51.17 ms
c4e097a+dirty 382.43 ms 443.77 ms 61.34 ms
c08359e+dirty 406.04 ms 428.87 ms 22.83 ms
785ffb1+dirty 380.65 ms 451.83 ms 71.18 ms
8ece263+dirty 369.44 ms 414.65 ms 45.21 ms
c9e95bd+dirty 339.32 ms 401.24 ms 61.92 ms
276d348+dirty 356.30 ms 405.27 ms 48.97 ms
49ef936+dirty 333.72 ms 387.51 ms 53.79 ms
2b89ce9+dirty 372.22 ms 417.06 ms 44.84 ms

App size

Revision Plain With Sentry Diff
f234eb4+dirty 7.15 MiB 8.46 MiB 1.30 MiB
5c16cdc+dirty 7.15 MiB 8.41 MiB 1.26 MiB
c4e097a+dirty 7.15 MiB 8.41 MiB 1.26 MiB
c08359e+dirty 7.15 MiB 8.42 MiB 1.27 MiB
785ffb1+dirty 7.15 MiB 8.42 MiB 1.27 MiB
8ece263+dirty 7.15 MiB 8.41 MiB 1.26 MiB
c9e95bd+dirty 7.15 MiB 8.41 MiB 1.26 MiB
276d348+dirty 7.15 MiB 8.42 MiB 1.26 MiB
49ef936+dirty 7.15 MiB 8.42 MiB 1.26 MiB
2b89ce9+dirty 7.15 MiB 8.41 MiB 1.26 MiB

Previous results on branch: rz/feat/screenshot-strategy-option

Startup times

Revision Plain With Sentry Diff
ab6c522+dirty 318.25 ms 354.94 ms 36.69 ms

App size

Revision Plain With Sentry Diff
ab6c522+dirty 7.15 MiB 8.46 MiB 1.30 MiB

@github-actions
Copy link
Contributor

github-actions bot commented Oct 23, 2025

iOS (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1213.37 ms 1230.64 ms 17.26 ms
Size 2.63 MiB 4.00 MiB 1.37 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
d1fd647+dirty 1219.35 ms 1233.18 ms 13.83 ms
46bd012+dirty 1220.49 ms 1226.89 ms 6.40 ms
8490686+dirty 1227.84 ms 1228.91 ms 1.08 ms
8db9631+dirty 1223.60 ms 1224.56 ms 0.96 ms
6fee48d+dirty 1222.14 ms 1231.44 ms 9.30 ms
5526494+dirty 1224.73 ms 1229.08 ms 4.36 ms
21c9e75+dirty 1237.78 ms 1247.66 ms 9.88 ms
f70acbf+dirty 1235.71 ms 1243.14 ms 7.43 ms
bc9680d+dirty 1221.41 ms 1241.47 ms 20.06 ms
af9331b+dirty 1233.61 ms 1230.50 ms -3.11 ms

App size

Revision Plain With Sentry Diff
d1fd647+dirty 2.63 MiB 3.99 MiB 1.36 MiB
46bd012+dirty 2.63 MiB 3.81 MiB 1.18 MiB
8490686+dirty 2.63 MiB 4.00 MiB 1.36 MiB
8db9631+dirty 2.63 MiB 4.00 MiB 1.36 MiB
6fee48d+dirty 2.63 MiB 3.96 MiB 1.33 MiB
5526494+dirty 2.63 MiB 3.87 MiB 1.24 MiB
21c9e75+dirty 2.63 MiB 3.81 MiB 1.18 MiB
f70acbf+dirty 2.63 MiB 3.98 MiB 1.34 MiB
bc9680d+dirty 2.63 MiB 3.81 MiB 1.18 MiB
af9331b+dirty 2.63 MiB 3.91 MiB 1.28 MiB

Previous results on branch: rz/feat/screenshot-strategy-option

Startup times

Revision Plain With Sentry Diff
ab6c522+dirty 1235.52 ms 1241.49 ms 5.97 ms

App size

Revision Plain With Sentry Diff
ab6c522+dirty 2.63 MiB 4.00 MiB 1.37 MiB

@github-actions
Copy link
Contributor

github-actions bot commented Oct 23, 2025

iOS (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1217.20 ms 1204.92 ms -12.28 ms
Size 3.19 MiB 4.57 MiB 1.38 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
d1fd647+dirty 1218.16 ms 1225.82 ms 7.65 ms
46bd012+dirty 1231.78 ms 1212.30 ms -19.47 ms
8490686+dirty 1227.32 ms 1240.82 ms 13.50 ms
8db9631+dirty 1226.92 ms 1226.06 ms -0.85 ms
6fee48d+dirty 1208.85 ms 1218.52 ms 9.67 ms
5526494+dirty 1217.06 ms 1222.26 ms 5.20 ms
21c9e75+dirty 1206.20 ms 1223.54 ms 17.35 ms
f70acbf+dirty 1239.00 ms 1242.53 ms 3.53 ms
bc9680d+dirty 1228.57 ms 1233.64 ms 5.07 ms
af9331b+dirty 1230.08 ms 1233.24 ms 3.16 ms

App size

Revision Plain With Sentry Diff
d1fd647+dirty 3.19 MiB 4.56 MiB 1.37 MiB
46bd012+dirty 3.19 MiB 4.38 MiB 1.19 MiB
8490686+dirty 3.19 MiB 4.56 MiB 1.38 MiB
8db9631+dirty 3.19 MiB 4.56 MiB 1.38 MiB
6fee48d+dirty 3.19 MiB 4.53 MiB 1.35 MiB
5526494+dirty 3.19 MiB 4.44 MiB 1.25 MiB
21c9e75+dirty 3.19 MiB 4.38 MiB 1.19 MiB
f70acbf+dirty 3.19 MiB 4.54 MiB 1.36 MiB
bc9680d+dirty 3.19 MiB 4.38 MiB 1.19 MiB
af9331b+dirty 3.19 MiB 4.48 MiB 1.29 MiB

Previous results on branch: rz/feat/screenshot-strategy-option

Startup times

Revision Plain With Sentry Diff
ab6c522+dirty 1219.49 ms 1241.56 ms 22.07 ms

App size

Revision Plain With Sentry Diff
ab6c522+dirty 3.19 MiB 4.57 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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alwx @antonis What do you think of updating other platform specific options with @platform?

Copy link
Contributor

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 👍

@lucas-zimerman
Copy link
Collaborator

Thank you for the PR!

Copy link
Contributor

@antonis antonis left a 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 🙇

@romtsn romtsn merged commit 2225fc5 into main Oct 29, 2025
72 of 73 checks passed
@romtsn romtsn deleted the rz/feat/screenshot-strategy-option branch October 29, 2025 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose new experimental Canvas Capture Strategy on Android

4 participants