feat(core): Apply scope attributes to metrics#18738
Merged
Conversation
This was referenced Jan 8, 2026
Contributor
size-limit report 📦
|
Contributor
node-overhead report 🧳Note: This is a synthetic benchmark with a minimal express app and does not necessarily reflect the real-world performance impact in an application.
|
6 tasks
05093f8 to
0c36d47
Compare
0c36d47 to
219e1ef
Compare
219e1ef to
3c13f13
Compare
chargome
approved these changes
Jan 9, 2026
Member
chargome
left a comment
There was a problem hiding this comment.
Thanks for taking care of this!
|
|
||
| // Enrich metric with contextual attributes | ||
| const enrichedMetric = _enrichMetricAttributes(beforeMetric, client, currentScope); | ||
| const { user, attributes: scopeAttributes } = getCombinedScopeData(getIsolationScope(), currentScope); |
Member
Author
There was a problem hiding this comment.
I was also surprised but yes 😅
sentry-javascript/packages/core/src/scope.ts
Line 163 in 1535106
3c13f13 to
4b4d0d3
Compare
This was referenced Jan 9, 2026
Lms24
added a commit
to getsentry/sentry-docs
that referenced
this pull request
Jan 14, 2026
Documents `scope.setAttribute(s)` which will be applied to metrics once getsentry/sentry-javascript#18738 is merged and released.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Applies scope attributes to metrics, analogously to how we apply them to logs (see #18184). Added unit and integration tests.
closes #18160