Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 40 commits into from
Jun 11, 2024

Conversation

cy-moi
Copy link
Contributor

@cy-moi cy-moi commented Apr 15, 2024

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:

Header Header
allow The action names are collected
mask The action names are not collected
mask-user-input The action names are collected since we don’t rely on the user input value to compute the action name
hidden The actions are not collected

This also works for html override data-dd-privacy accordingly.

Testing

  • Local
  • Staging
  • Unit
  • End to end

I have gone over the contributing documentation.

Copy link

cit-pr-commenter bot commented Apr 17, 2024

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

@codecov-commenter
Copy link

codecov-commenter commented Apr 17, 2024

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 ⚠️
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     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@cy-moi

This comment was marked as outdated.

@dd-devflow

This comment was marked as duplicate.

dd-mergequeue bot added a commit that referenced this pull request Apr 24, 2024
@dd-devflow

This comment was marked as outdated.

@cy-moi cy-moi self-assigned this Apr 26, 2024
@bits-bot
Copy link

bits-bot commented Apr 29, 2024

CLA assistant check
All committers have signed the CLA.

@cy-moi cy-moi force-pushed the congyao/RUM-3902-privacy-control-action-name branch from f5fd1a2 to 18eaec5 Compare April 29, 2024 14:23
@cy-moi cy-moi marked this pull request as ready for review April 29, 2024 14:58
@cy-moi cy-moi requested a review from a team as a code owner April 29, 2024 14:58
@cy-moi

This comment was marked as outdated.

@dd-devflow

This comment was marked as outdated.

@dd-devflow
Copy link

dd-devflow bot commented May 24, 2024

⚠️ 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!

@cy-moi cy-moi removed their assignment Jun 5, 2024
@cy-moi cy-moi merged commit 9329edb into main Jun 11, 2024
20 checks passed
@cy-moi cy-moi deleted the congyao/RUM-3902-privacy-control-action-name branch June 11, 2024 08:22
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.

5 participants