Skip to content

Comments

feat: Add attrUnmaskAllowlist RUM config option#4209

Open
andrewatwood wants to merge 1 commit intoDataDog:mainfrom
andrewatwood:feature/attr-allowerlist
Open

feat: Add attrUnmaskAllowlist RUM config option#4209
andrewatwood wants to merge 1 commit intoDataDog:mainfrom
andrewatwood:feature/attr-allowerlist

Conversation

@andrewatwood
Copy link
Contributor

@andrewatwood andrewatwood commented Feb 18, 2026

Motivation

When masking is enabled, RUM automatically masks all data-* attributes to prevent data leakage and slim down replay frame payloads. However, some UI libraries use CSS selectors that target certain data-* attributes and values, which can lead to breakage of styles and rendering issues during replay playback. We need a way to maintain these styles during playback and this seems like a relatively straightforward way to do so.

I thought about making this a map of attributes and allowed values for each attribute, but wanted to keep the surface of the checks small. There may be some perf optimization needed for such a high-frequency check but tested this as a proof-of-concept locally and saw the results I was after, so just starting with this base implementation to get a temperature check on a feature like this.

Changes

  • Adds a attrUnmaskAllowlist option to the RUM configuration
  • Reads from this list when present to determine masking behavior for attributes

Test instructions

  • Create an element with CSS rules targeting specific data-* attribute values (ie. data-state=open)
  • Initiate a RUM session with replay enabled and no attrUnmaskAllowlist provided
  • Verify that the replay does not render the intended styles due to masking the attribute value
  • Update the config to include a relevant attrUnmaskAllowlist
  • Verify that the next replay DOES render the intended styles due to preservation of the attribute value

Once again I will likely need integration test help as I'm unable to run suites beyond the unit tests.

Checklist

  • Tested locally
  • Tested on staging
  • Added unit tests for this change.
  • Added e2e/integration tests for this change.
  • Updated documentation and/or relevant AGENTS.md file

@andrewatwood andrewatwood requested review from a team as code owners February 18, 2026 17:24
@andrewatwood andrewatwood force-pushed the feature/attr-allowerlist branch 3 times, most recently from 223ec43 to 019da50 Compare February 18, 2026 17:40
@andrewatwood andrewatwood marked this pull request as draft February 18, 2026 17:42
Signed-off-by: andrewatwood <sandurz@gmail.com>
@andrewatwood andrewatwood force-pushed the feature/attr-allowerlist branch from 019da50 to 838f1b1 Compare February 18, 2026 18:28
@andrewatwood andrewatwood marked this pull request as ready for review February 18, 2026 18:29
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