Skip to content

Conversation

@markushi
Copy link
Member

@markushi markushi commented Feb 2, 2026

📜 Description

Add a ReplayCustomMasking fake 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?

  • Added unit tests to verify the integration is added when masking APIs are called
  • Verified default options 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.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 2, 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 ✨

Replay

  • Track custom masking usage via integration by markushi in #5070
  • Track custom masking usage via integration by markushi in #5070

Other

  • (distribution) Add installGroupsOverride parameter by runningcode in #5066

Internal Changes 🔧

Deps

  • Bump github/codeql-action from 4.32.0 to 4.32.2 by dependabot in #5082
  • Update Native SDK to v0.12.6 by github-actions in #5071

🤖 This preview updates automatically when you update the PR.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 2, 2026

Fails
🚫 Please consider adding a changelog entry for the next release.
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Instructions and example for changelog

Please add an entry to CHANGELOG.md to the "Unreleased" section. Make sure the entry includes this PR's number.

Example:

## Unreleased

### Features

- Track custom masking usage via integration ([#5070](https://github.com/getsentry/sentry-java/pull/5070))

If none of the above apply, you can opt out of this check by adding #skip-changelog to the PR description or adding a skip-changelog label.

Generated by 🚫 dangerJS against b923bdd

markushi added a commit that referenced this pull request Feb 2, 2026
@markushi markushi force-pushed the feat/replay-custom-masking-integration branch from d97cb99 to d515e2f Compare February 2, 2026 12:40
@markushi markushi changed the title feat(replay): Track custom masking usage via fake integration feat(replay): Track custom masking usage via integration Feb 2, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Feb 2, 2026

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 311.17 ms 355.96 ms 44.79 ms
Size 1.58 MiB 2.28 MiB 718.64 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

Previous results on branch: feat/replay-custom-masking-integration

Startup times

Revision Plain With Sentry Diff
c7356ce 327.32 ms 398.62 ms 71.30 ms
84c7a63 306.38 ms 358.82 ms 52.43 ms
390bb6d 323.92 ms 371.71 ms 47.79 ms
8397b55 317.12 ms 362.14 ms 45.02 ms
1c65061 315.52 ms 365.20 ms 49.68 ms

App size

Revision Plain With Sentry Diff
c7356ce 1.58 MiB 2.28 MiB 716.25 KiB
84c7a63 1.58 MiB 2.28 MiB 718.64 KiB
390bb6d 1.58 MiB 2.28 MiB 716.29 KiB
8397b55 1.58 MiB 2.28 MiB 716.28 KiB
1c65061 1.58 MiB 2.19 MiB 619.14 KiB

Copy link
Member

@romtsn romtsn left a comment

Choose a reason for hiding this comment

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

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:

if (
(tag as? String)?.lowercase()?.contains(SENTRY_UNMASK_TAG) == true ||
getTag(R.id.sentry_privacy) == "unmask"
) {
return false
}
if (
(tag as? String)?.lowercase()?.contains(SENTRY_MASK_TAG) == true ||
getTag(R.id.sentry_privacy) == "mask"
) {
return true
}

and here for Compose:

if (sentryPrivacyModifier == "unmask") {
return false
}
if (sentryPrivacyModifier == "mask") {
return true
}

although it might be heavy (even for a CopyOnWriteSet), so maybe we need some flag to just add it to integrations once

markushi and others added 4 commits February 10, 2026 08:41
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>
@markushi markushi force-pushed the feat/replay-custom-masking-integration branch from 61aff6b to cc57cc5 Compare February 10, 2026 07:54
@markushi markushi marked this pull request as ready for review February 10, 2026 08:11
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 3 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

Copy link
Member

@romtsn romtsn left a comment

Choose a reason for hiding this comment

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

LGTM, besides one bugbot comment

@markushi markushi enabled auto-merge (squash) February 10, 2026 11:20
@markushi markushi force-pushed the feat/replay-custom-masking-integration branch from e31fbd0 to b923bdd Compare February 10, 2026 14:13
@markushi markushi merged commit 6727e14 into main Feb 10, 2026
60 of 63 checks passed
@markushi markushi deleted the feat/replay-custom-masking-integration branch February 10, 2026 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants