-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat(core): Add user to logs #16399
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
feat(core): Add user to logs #16399
Conversation
packages/core/src/logs/exports.ts
Outdated
* @param currentScope - The current scope. | ||
* @returns The scope data. | ||
*/ | ||
function getScopeData(currentScope: Scope): ScopeData { |
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.
l/also fine as follow-up: Wdyt about making this a utility function? We have very similar logic in our event processing pipeline
sentry-javascript/packages/core/src/utils/prepareEvent.ts
Lines 82 to 93 in 56137a8
const data = getGlobalScope().getScopeData(); | |
if (isolationScope) { | |
const isolationData = isolationScope.getScopeData(); | |
mergeScopeData(data, isolationData); | |
} | |
if (finalScope) { | |
const finalScopeData = finalScope.getScopeData(); | |
mergeScopeData(data, finalScopeData); | |
} | |
as well as in Node ANR (though admittedly I don't care much about the bundle size there)
might save some bytes and it might help us get rid of the complexity eslint comment (though again, low prio obviously)
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.
also can we rename this to e.g. getMergedScopeData()
or something like this, was not clear to me from the function name that this would consider isolation scope etc :)
Will think about the utility function as a follow up |
031af1c
to
4f6f301
Compare
resolves https://linear.app/getsentry/issue/JS-294
ref https://develop.sentry.dev/sdk/telemetry/logs/#user-attributes