Skip to content

feat(replay): Track custom masking usage via integration#5070

Draft
markushi wants to merge 3 commits intomainfrom
feat/replay-custom-masking-integration
Draft

feat(replay): Track custom masking usage via integration#5070
markushi wants to merge 3 commits intomainfrom
feat/replay-custom-masking-integration

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.

🔮 Next steps

Monitor adoption via Looker dashboards.

@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 ✨

  • (distribution) Add install_groups support by runningcode in #5062
  • (replay) Track custom masking usage via integration by markushi in #5070
  • (spotlight) Extract SpotlightIntegration to separate module by romtsn in #5064

Bug Fixes 🐛

  • Establish native exception mechanisms by supervacuus in #5052

Internal Changes 🔧

Deps

  • Bump github/codeql-action from 4.31.11 to 4.32.0 by dependabot in #5067
  • Bump gradle/actions from 5.0.0 to 5.0.1 by dependabot in #5068
  • Bump getsentry/craft from 2.20.0 to 2.20.1 by dependabot in #5069
  • Bump urllib3 from 2.6.0 to 2.6.3 in the pip group across 1 directory by dependabot in #5003
  • Update Native SDK to v0.12.4 by github-actions in #5061
  • Bump getsentry/github-workflows/.github/workflows/updater.yml from 2 to 3 by dependabot in #4884
  • Bump actions/cache from 4 to 5 by dependabot in #4997
  • Bump github/codeql-action from 4.31.10 to 4.31.11 by dependabot in #5057
  • Bump getsentry/craft from 2.19.0 to 2.20.0 by dependabot in #5058

Other

  • (android) Update targetSdk to API 36 (Android 16) by markushi in #5016
  • (ci) Write permission for statuses in changelog preview by supervacuus in #5053
  • (samples) Convert main screen to Jetpack Compose by markushi in #5017

🤖 This preview updates automatically when you update the PR.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 2, 2026

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

Generated by 🚫 dangerJS against 61aff6b

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 315.52 ms 365.20 ms 49.68 ms
Size 1.58 MiB 2.19 MiB 619.14 KiB

Baseline results on branch: main

Startup times

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

Comment on lines 362 to 372
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;
}
Copy link
Member

Choose a reason for hiding this comment

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

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

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.

2 participants