feat(replay): Track custom masking usage via integration#5070
feat(replay): Track custom masking usage via integration#5070
Conversation
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨
Bug Fixes 🐛
Internal Changes 🔧Deps
Other
🤖 This preview updates automatically when you update the PR. |
|
d97cb99 to
d515e2f
Compare
Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 27d7cf8 | 306.76 ms | 366.66 ms | 59.90 ms |
| f064536 | 327.04 ms | 405.35 ms | 78.31 ms |
| fc5ccaf | 279.11 ms | 353.34 ms | 74.23 ms |
| b750b96 | 408.98 ms | 480.32 ms | 71.34 ms |
| e59e22a | 329.74 ms | 383.31 ms | 53.57 ms |
| 2124a46 | 319.19 ms | 415.04 ms | 95.85 ms |
| 18c0bc2 | 306.73 ms | 349.77 ms | 43.03 ms |
| 85d7417 | 347.21 ms | 394.35 ms | 47.15 ms |
| 96449e8 | 361.30 ms | 423.39 ms | 62.09 ms |
| ce0a49e | 532.00 ms | 609.96 ms | 77.96 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 27d7cf8 | 1.58 MiB | 2.12 MiB | 549.42 KiB |
| f064536 | 1.58 MiB | 2.20 MiB | 633.90 KiB |
| fc5ccaf | 1.58 MiB | 2.13 MiB | 557.54 KiB |
| b750b96 | 1.58 MiB | 2.10 MiB | 533.19 KiB |
| e59e22a | 1.58 MiB | 2.20 MiB | 635.34 KiB |
| 2124a46 | 1.58 MiB | 2.12 MiB | 551.51 KiB |
| 18c0bc2 | 1.58 MiB | 2.13 MiB | 557.33 KiB |
| 85d7417 | 1.58 MiB | 2.10 MiB | 533.44 KiB |
| 96449e8 | 1.58 MiB | 2.11 MiB | 539.35 KiB |
| ce0a49e | 1.58 MiB | 2.10 MiB | 532.94 KiB |
| public void setMaskViewContainerClass(@NotNull String containerClass) { | ||
| addMaskViewClass(containerClass); | ||
| addIntegrationToSdkVersion(CUSTOM_MASKING_INTEGRATION_NAME); | ||
| maskViewClasses.add(containerClass); | ||
| maskViewContainerClass = containerClass; | ||
| } | ||
|
|
||
| @ApiStatus.Internal | ||
| public void setUnmaskViewContainerClass(@NotNull String containerClass) { | ||
| addIntegrationToSdkVersion(CUSTOM_MASKING_INTEGRATION_NAME); | ||
| unmaskViewContainerClass = containerClass; | ||
| } |
There was a problem hiding this comment.
I think these 2 we probably don't need to track, because RN always adds them unconditionally: https://github.com/getsentry/sentry-react-native/blob/49d17448bedc1338411f2c1576b1133e24741cfc/packages/core/android/src/main/java/io/sentry/react/RNSentryModuleImpl.java#L454-L455
romtsn
left a comment
There was a problem hiding this comment.
Looks good already, but could you also add tracking when somebody sets a custom view tag? I think you could just add the fake integration whenever we encounter one of the tags here:
and here for Compose:
although it might be heavy (even for a CopyOnWriteSet), so maybe we need some flag to just add it to integrations once
📜 Description
Add a
ReplayCustomMaskingfake integration whenever users call any custom masking API. This tracks adoption of custom masking configurations to help measure usage before potentially switching to the canvas strategy.The integration is added when any of these methods are called:
setMaskAllText()setMaskAllImages()addMaskViewClass()addUnmaskViewClass()setMaskViewContainerClass()setUnmaskViewContainerClass()💡 Motivation and Context
We want to track how many users are using custom masking configurations before potentially switching to the canvas recording strategy. This fake integration will appear in the SDK integrations list and can be queried in Looker.
💚 How did you test it?
📝 Checklist
sendDefaultPiiis enabled.🔮 Next steps
Monitor adoption via Looker dashboards.