Skip to content

Conversation

@markushi
Copy link
Member

📜 Description

Add a ReplayCustomMasking fake integration whenever users use any custom masking API. This tracks adoption of custom masking configurations to help measure usage before potentially switching to the canvas strategy.

Tracking is triggered when any of these are used:

  • setMaskAllText()
  • setMaskAllImages()
  • addMaskViewClass()
  • addUnmaskViewClass()
  • sentry-mask / sentry-unmask view tags
  • sentryReplayMask() / sentryReplayUnmask() Compose modifiers

Container class setters (setMaskViewContainerClass / setUnmaskViewContainerClass) are excluded since React Native sets them unconditionally.

A volatile boolean flag ensures the integration is only registered once, avoiding repeated CopyOnWriteArraySet operations during view hierarchy traversal.

💡 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?

  • Added unit tests to verify the integration is added when masking APIs are called
  • Verified default options don't trigger the integration
  • Verified container class setters don't trigger the integration

📝 Checklist

  • I added GH Issue ID & Linear ID
  • I added tests to verify the 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.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

🔮 Next steps

Monitor adoption via Looker dashboards.

markushi and others added 6 commits February 2, 2026 13:36
Remove tracking from container class setters (RN sets them unconditionally)
and add tracking when custom view tags or Compose privacy modifiers are
encountered. Uses a volatile flag to avoid repeated integration additions
per view.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…methods

Replace direct addIntegrationToSdkVersion calls with trackCustomMaskingTag()
in setMaskAllText, setMaskAllImages, addMaskViewClass, and addUnmaskViewClass
so all entry points benefit from the volatile flag optimization.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- customMaskingTagTracked -> customMaskingTracked
- trackCustomMaskingTag() -> trackCustomMasking()
- resetCustomMaskingTagTracked() -> resetCustomMaskingTracked()

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Contributor

github-actions bot commented Feb 10, 2026

Semver Impact of This PR

🟡 Minor (new features)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

  • (distribution) Add installGroupsOverride parameter by runningcode in #5066
  • (replay) Track custom masking usage via integration by markushi in #5088

🤖 This preview updates automatically when you update the PR.

@github-actions
Copy link
Contributor

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

Generated by 🚫 dangerJS against cc57cc5

@markushi markushi closed this Feb 10, 2026
@github-actions
Copy link
Contributor

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 306.17 ms 360.84 ms 54.67 ms
Size 1.58 MiB 2.28 MiB 716.28 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
fcec2f2 314.96 ms 373.66 ms 58.70 ms
ee747ae 554.98 ms 611.50 ms 56.52 ms
27d7cf8 306.76 ms 366.66 ms 59.90 ms
fcec2f2 328.91 ms 387.75 ms 58.84 ms
8687935 332.52 ms 362.23 ms 29.71 ms
b77456b 393.26 ms 441.10 ms 47.84 ms
ee747ae 400.46 ms 423.61 ms 23.15 ms
ee747ae 374.71 ms 455.18 ms 80.47 ms
bbc35bb 298.53 ms 372.17 ms 73.64 ms
94bff8d 313.23 ms 352.77 ms 39.54 ms

App size

Revision Plain With Sentry Diff
fcec2f2 1.58 MiB 2.12 MiB 551.50 KiB
ee747ae 1.58 MiB 2.10 MiB 530.95 KiB
27d7cf8 1.58 MiB 2.12 MiB 549.42 KiB
fcec2f2 1.58 MiB 2.12 MiB 551.50 KiB
8687935 1.58 MiB 2.19 MiB 619.17 KiB
b77456b 1.58 MiB 2.12 MiB 548.11 KiB
ee747ae 1.58 MiB 2.10 MiB 530.95 KiB
ee747ae 1.58 MiB 2.10 MiB 530.95 KiB
bbc35bb 1.58 MiB 2.12 MiB 553.01 KiB
94bff8d 1.58 MiB 2.20 MiB 635.37 KiB

markushi added a commit that referenced this pull request Feb 10, 2026
* feat(replay): Track custom masking usage via fake integration

* chore(changelog): Add PR #5070 to changelog

* fix(replay): Address PR feedback for custom masking tracking

Remove tracking from container class setters (RN sets them unconditionally)
and add tracking when custom view tags or Compose privacy modifiers are
encountered. Uses a volatile flag to avoid repeated integration additions
per view.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(replay): Use trackCustomMaskingTag() consistently in all masking methods

Replace direct addIntegrationToSdkVersion calls with trackCustomMaskingTag()
in setMaskAllText, setMaskAllImages, addMaskViewClass, and addUnmaskViewClass
so all entry points benefit from the volatile flag optimization.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* refactor(replay): Rename custom masking tracking methods

- customMaskingTagTracked -> customMaskingTracked
- trackCustomMaskingTag() -> trackCustomMasking()
- resetCustomMaskingTagTracked() -> resetCustomMaskingTracked()

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* chore(changelog): Update PR reference to #5088

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Format code

* Fix Changelog

* fix slop

* Address PR comments

* Format code

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Sentry Github Bot <bot+github-bot@sentry.io>
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.

1 participant