designcourse icon indicating copy to clipboard operation
designcourse copied to clipboard

✨ [RUM-3902] Add privacy control for action names

Open cy-moi opened this issue 1 year ago • 11 comments

Motivation

To be consistent with session Replay and ease the customer configuration, we could use the same privacy options as Replay. To avoid breaking changes, we need to add an extra init option that indicates the action names should take into account the defaultPrivacyLevel and the HTML overrides.

Desired behavior

When the user opt-in for enablePrivacyForActionName, we mask action names when no action name attributes given and no html override.

When the user does not opt-in for this feature, we mask action names when html override is set.

Changes

Add an opt-in field enablePrivacyForActionName: boolean in configuration. Once enablePrivacyForActionName: true, the action name computation would behave (taking into account of all privacy configs) as follow:

defaultPrivacyLevel enablePrivacyForActionName data-dd-privacy override data-dd-action-name(or custom) action name collection strategy
hidden N/A N/A N/A no behavior change: we don't collect actions
allow or mask-user-input or undefined false N/A N/A no behavior change
allow or mask-user-input or undefined true hidden N/A we don't collect acions
allow or mask-user-input or undefined true mask N/A we mask the action name
allow or mask-user-input or undefined true allow or mask-user-input or undefined N/A no behavior change
mask false N/A N/A no behavior change
mask true hidden N/A we don't collect actions
mask true mask N/A we mask the action name
mask true allow or mask-user-input N/A no behavior change for current node and its children
mask false N/A N/A no behavior change

When N/A, it means doesn't matter

Testing

  • [x] Local
  • [ ] Staging
  • [ ] Unit
  • [ ] End to end

I have gone over the contributing documentation.

cy-moi avatar Apr 15 '24 13:04 cy-moi

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum 159.09 KiB 159.49 KiB 407 B +0.25%
Logs 57.72 KiB 57.78 KiB 66 B +0.11%
Rum Slim 105.56 KiB 108.07 KiB 2.51 KiB +2.38%
Worker 25.21 KiB 25.21 KiB 0 B 0.00%
🚀 CPU Performance
Action Name Base Average Cpu Time (ms) Local Average Cpu Time (ms) 𝚫
addglobalcontext 0.002 0.002 0.000
addaction 0.035 0.046 0.011
adderror 0.040 0.041 0.001
addtiming 0.001 0.001 0.000
startview 1.133 1.149 0.016
startstopsessionreplayrecording 0.820 1.288 0.468
logmessage 0.005 0.006 0.001
🧠 Memory Performance
Action Name Base Consumption Memory (bytes) Local Consumption Memory (bytes) 𝚫 (bytes)
addglobalcontext 19.44 KiB 20.18 KiB 761 B
addaction 70.99 KiB 71.15 KiB 163 B
adderror 83.73 KiB 84.88 KiB 1.16 KiB
addtiming 18.80 KiB 16.11 KiB -2753 B
startview 311.88 KiB 318.77 KiB 6.89 KiB
startstopsessionreplayrecording 13.14 KiB 12.11 KiB -1057 B
logmessage 66.36 KiB 67.67 KiB 1.31 KiB

cit-pr-commenter[bot] avatar Apr 17 '24 10:04 cit-pr-commenter[bot]

Codecov Report

Attention: Patch coverage is 98.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 93.62%. Comparing base (dfcb3cc) to head (0582b8a). Report is 8 commits behind head on main.

Files Patch % Lines
...core/src/domain/action/getActionNameFromElement.ts 95.65% 1 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2707      +/-   ##
==========================================
+ Coverage   93.60%   93.62%   +0.02%     
==========================================
  Files         243      242       -1     
  Lines        7094     7108      +14     
  Branches     1580     1589       +9     
==========================================
+ Hits         6640     6655      +15     
+ Misses        454      453       -1     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar Apr 17 '24 10:04 codecov-commenter

/to-staging

cy-moi avatar Apr 24 '24 15:04 cy-moi

:steam_locomotive: Branch Integration: starting soon, merge in < 9m

Commit f0dacd92df will soon be integrated into staging-17.

This build is going to start soon! (estimated merge in less than 9m)

Use /to-staging -c to cancel this operation!

dd-devflow[bot] avatar Apr 24 '24 15:04 dd-devflow[bot]

:steam_locomotive: Branch Integration: This commit was successfully integrated

Commit f0dacd92df has been merged into staging-17 in merge commit b29d98bf3d.

Check out the triggered pipeline on Gitlab :fox_face:

dd-devflow[bot] avatar Apr 24 '24 15:04 dd-devflow[bot]

CLA assistant check
All committers have signed the CLA.

bits-bot avatar Apr 29 '24 14:04 bits-bot

/to-staging

cy-moi avatar May 02 '24 11:05 cy-moi

:steam_locomotive: Branch Integration: starting soon, merge in < 9m

Commit 520e573fa9 will soon be integrated into staging-18.

This build is going to start soon! (estimated merge in less than 9m)

Use /to-staging -c to cancel this operation!

dd-devflow[bot] avatar May 02 '24 11:05 dd-devflow[bot]

:rotating_light: Branch Integration: This merge request has conflicts

We couldn't automatically merge the commit 520e573fa9 into staging-18!

You can use this resolution PR: #2737 to fix the conflicts.

If you need support, contact us on Slack #devflow with those details!

dd-devflow[bot] avatar May 02 '24 11:05 dd-devflow[bot]

:steam_locomotive: Branch Integration: starting soon, merge in < 9m

Commit 520e573fa9 will soon be integrated into staging-18.

This build is going to start soon! (estimated merge in less than 9m)

dd-devflow[bot] avatar May 02 '24 12:05 dd-devflow[bot]

:steam_locomotive: Branch Integration

Commit 520e573fa9 has been merged into staging-18 in merge commit 3262c89300.

Check out the triggered pipeline on Gitlab :fox_face:

dd-devflow[bot] avatar May 02 '24 12:05 dd-devflow[bot]

/to-staging

cy-moi avatar May 16 '24 11:05 cy-moi

:steam_locomotive: Branch Integration: starting soon, merge in < 9m

Commit 62e821f361 will soon be integrated into staging-20.

This build is going to start soon! (estimated merge in less than 9m)

Use /to-staging -c to cancel this operation!

dd-devflow[bot] avatar May 16 '24 11:05 dd-devflow[bot]

:steam_locomotive: Branch Integration: This commit was successfully integrated

Commit 62e821f361 has been merged into staging-20 in merge commit 3b75a444da.

Check out the triggered pipeline on Gitlab :fox_face:

dd-devflow[bot] avatar May 16 '24 11:05 dd-devflow[bot]

/to-staging

cy-moi avatar May 24 '24 13:05 cy-moi

:steam_locomotive: Branch Integration: starting soon, merge in < 9m

Commit 82036b1ee4 will soon be integrated into staging-21.

This build is going to start soon! (estimated merge in less than 9m)

Use /to-staging -c to cancel this operation!

dd-devflow[bot] avatar May 24 '24 13:05 dd-devflow[bot]

:warning: Branch Integration: This commit was already integrated

Commit 82036b1ee4 had already been merged into staging-21

If you need support, contact us on Slack #devflow!

dd-devflow[bot] avatar May 24 '24 13:05 dd-devflow[bot]