-
Notifications
You must be signed in to change notification settings - Fork 56
feat: Add useConsentModel functionality #1533
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
base: main
Are you sure you want to change the base?
Conversation
Supportability Metric Usage Changes:No matching changes found Supportability Metrics .md File Changes:supportability_metrics.md was changed? New supportability metrics require changes to supportability_metrics.md, as well as a new PR to Angler. Please ensure an Angler PR is created and linked to this PR. |
Asset Size Report
Merging this pull request will result in the following asset size changes:
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1533 +/- ##
==========================================
- Coverage 88.60% 88.53% -0.08%
==========================================
Files 206 207 +1
Lines 7748 7770 +22
Branches 1586 1593 +7
==========================================
+ Hits 6865 6879 +14
- Misses 772 777 +5
- Partials 111 114 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Adding API changes to PR, do not merge until ready. |
d4c9352 to
6d748e7
Compare
aa4f567 to
39a2b8b
Compare
|
can you please add type-check conditions for your new API method to |
|
we also haven't been very good about updating |
ea363df to
609dda9
Compare
metal-messiah
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very minor comment, i am fine with leaving as-is or changing. LGTM
|
Blocked until API team is out of code freeze and can implement settings changes. |
metal-messiah
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
manually blocking to prevent accidental merge
c7b091a to
1c16467
Compare
1c16467 to
0b04e4c
Compare
Adds useConsentModel init property and functionality. Adds the consent() API call. The consent model, if enabled, disallows agent harvesting unless consent is given through the consent() API call.
Overview
Adds useConsentModel init property and functionality (defaults to false). When turning
useConsentModelon, the agent will not harvest (send over the network) until given "consent". Consent is given by theconsentvalue in the session entity's local storage being set totrue.Adds an API method called
consent(accept?: boolean)that changes theconsentvalue in the session entity's local storage. Callingtrueorundefinedfor the argument grants consent, callingfalsein consent() rejects consent.Agent features are still manually or automatically started regardless of consent being enabled or not, but they won't send data over the network unless consent is granted.
Also adds a .nvmrc file for node version 22.11
Related Issue(s)
JIRA: https://new-relic.atlassian.net/browse/NR-438120
JIRA: https://new-relic.atlassian.net/browse/NR-438139
Testing
Tests are provided that tests the agent harvest blocking if the consent model is enabled in various situations. The default case (consent model not being enabled) is not tested since that's already covered.