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-2445] implement Tracking Consent management #2589

Merged
merged 13 commits into from Feb 12, 2024

Conversation

BenoitZugmeyer
Copy link
Member

@BenoitZugmeyer BenoitZugmeyer commented Feb 5, 2024

Motivation

Allows starting/stopping data collection based on user consent (ex: regarding to RGPD rules and such).

Related issue: #1008

Changes

For both RUM and Logs SDKs:

  • Introduce a trackingConsent: "granted"/"not-granted" initialization parameter (defaults to "granted" for backward compatibility)
  • Add a setTrackingConsent method to set the consent state before or after calling init(). If called before init(), the initialization parameter will be ignored.
  • On init, do not start collecting data until consent is granted
  • When the consent is withdrawn, stops the session and clear the cookie. No new session will be created on user interaction.
  • This change is behind an experimental flag and should not be used by customers yet.

Testing

  • Local
  • Staging
  • Unit
  • End to end

I have gone over the contributing documentation.

@BenoitZugmeyer
Copy link
Member Author

/to-staging

@dd-devflow
Copy link

dd-devflow bot commented Feb 5, 2024

🚂 Branch Integration: starting soon, merge in < 0s

Commit 2c328abf62 will soon be integrated into staging-06.

This build is going to start soon! (estimated merge in less than 0s)

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

dd-mergequeue bot added a commit that referenced this pull request Feb 5, 2024
…staging-06

Co-authored-by: Benoît Zugmeyer <benoit.zugmeyer@datadoghq.com>
@dd-devflow
Copy link

dd-devflow bot commented Feb 5, 2024

🚂 Branch Integration: This commit was successfully integrated

Commit 2c328abf62 has been merged into staging-06 in merge commit 8fd5da3faa.

Check out the triggered pipeline on Gitlab 🦊

@dd-devflow dd-devflow bot added the staging-06 label Feb 5, 2024
@BenoitZugmeyer BenoitZugmeyer marked this pull request as ready for review February 5, 2024 14:50
@BenoitZugmeyer BenoitZugmeyer requested a review from a team as a code owner February 5, 2024 14:50
@BenoitZugmeyer BenoitZugmeyer changed the title ✨ [RUM-2445] implement Tracking Consent management ⚗️✨ [RUM-2445] implement Tracking Consent management Feb 5, 2024
packages/rum-core/src/boot/rumPublicApi.ts Outdated Show resolved Hide resolved
packages/core/src/domain/trackingConsent.ts Outdated Show resolved Hide resolved
packages/logs/src/boot/logsPublicApi.ts Outdated Show resolved Hide resolved
packages/logs/src/boot/preStartLogs.ts Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (df1fccd) 92.78% compared to head (3e1b702) 92.79%.
Report is 6 commits behind head on main.

Files Patch % Lines
packages/logs/src/boot/logsPublicApi.ts 0.00% 1 Missing ⚠️
packages/rum-core/src/boot/rumPublicApi.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2589      +/-   ##
==========================================
+ Coverage   92.78%   92.79%   +0.01%     
==========================================
  Files         235      236       +1     
  Lines        6789     6828      +39     
  Branches     1487     1497      +10     
==========================================
+ Hits         6299     6336      +37     
- Misses        490      492       +2     

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

@BenoitZugmeyer
Copy link
Member Author

/to-staging

@dd-devflow
Copy link

dd-devflow bot commented Feb 7, 2024

🚂 Branch Integration: starting soon, merge in < 8m

Commit 2bfb326933 will soon be integrated into staging-06.

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

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

dd-mergequeue bot added a commit that referenced this pull request Feb 7, 2024
…staging-06

Co-authored-by: Benoît Zugmeyer <benoit.zugmeyer@datadoghq.com>
@dd-devflow
Copy link

dd-devflow bot commented Feb 7, 2024

🚂 Branch Integration: This commit was successfully integrated

Commit 2bfb326933 has been merged into staging-06 in merge commit d01c92fed2.

Check out the triggered pipeline on Gitlab 🦊

packages/logs/src/boot/logsPublicApi.ts Outdated Show resolved Hide resolved
packages/logs/src/boot/startLogs.ts Outdated Show resolved Hide resolved
packages/logs/src/boot/preStartLogs.ts Show resolved Hide resolved
@BenoitZugmeyer BenoitZugmeyer merged commit ed48184 into main Feb 12, 2024
17 checks passed
@BenoitZugmeyer BenoitZugmeyer deleted the benoit/consent--consent-withdraw branch February 12, 2024 10:49
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.

None yet

5 participants