-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
ref(tracing): Only add user_id
to DSC if sendDefaultPii
is true
#5344
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
Conversation
size-limit report 📦
|
37ba42c
to
c873b1c
Compare
user_id
to DSC if sendDefaultPii
is true
revert unintended yarn script deletion
c873b1c
to
841e236
Compare
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.
Change-to-test ratio in this PR is just... *chef's kiss* 🤌
function createTransactionOnScope(sendDefaultPii: boolean = true) { | ||
const options = getDefaultNodeClientOptions({ | ||
dsn: 'https://[email protected]/12312012', | ||
tracesSampleRate: 1.0, | ||
integrations: [new HttpIntegration({ tracing: true })], | ||
release: '1.0.0', | ||
environment: 'production', | ||
sendDefaultPii, | ||
}); |
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.
(optional) We could refactor this a bit so that createTransactionOnScope
takes node client options as an argument which override a default (default being what's there now).
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.
Yes, good idea; that seems like a more sustainable solution
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.
it('does not add the user_id to the baggage header if sendDefaultPii is set to false', async () => { | ||
nock('http://dogs.are.great').get('/').reply(200); | ||
|
||
createTransactionOnScope(false); |
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.
Just seeing this in tests is so glorius. Sentry.startTransaction()
should really just instantly put a transaction on the scope... I hope we get to that some day.
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.
Yup, I 100% agree
takes now an options argument instead of just the sendDefaultPii flag
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.
Thanks for adding my suggestion :D
This PR adds the check if
sendDefaultPii
is set totrue
before adding theuser_id
when populating DSC.Additionally, the PR adds some tests to check for the changed behaviour.
resolves #5343