feat(core): Apply scope attributes to logs#18184
Merged
Conversation
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.
|
52339f2 to
b97b3f4
Compare
a3e204d to
205752c
Compare
5053159 to
e5785ea
Compare
fbbd768 to
04d75b1
Compare
Base automatically changed from
lms/feat-core-scope-setAttributes
to
develop
November 21, 2025 14:42
e5785ea to
561085c
Compare
e575427 to
5388d82
Compare
Member
Author
|
UPDATE: See PR description for updated behaviour OK, so we still have 2 problems and a minor inconvenience here:
|
Member
Author
|
To at least offer partial support, we settled on only serializing primitive, and discarding non-primitive scope attribute values. I update the PR and the PR description accordingly. |
Lms24
commented
Dec 16, 2025
| * @param value - The value of the log attribute. | ||
| * @returns The serialized log attribute. | ||
| */ | ||
| export function logAttributeToSerializedLogAttribute(value: unknown): SerializedLogAttributeValue { |
Member
Author
There was a problem hiding this comment.
Since we have a fallback parameter in attributeValueToTypedAttributeValue, we can get rid of this logic. For now the bundle size savings are minimal but once we migrate logs to the new unified function, it should pay off.
|
|
||
| mergeAndOverwriteScopeData(data, 'extra', extra); | ||
| mergeAndOverwriteScopeData(data, 'tags', tags); | ||
| mergeAndOverwriteScopeData(data, 'attributes', attributes); |
s1gr1d
reviewed
Dec 16, 2025
4c57fcb to
b70a546
Compare
AbhiPrasad
added a commit
to getsentry/sentry-docs
that referenced
this pull request
Dec 18, 2025
Lms24
added a commit
that referenced
this pull request
Jan 9, 2026
Applies scope attributes to metrics, analogously to how we apply them to logs (see #18184). Added unit and integration tests.
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.
This PR adds support for scope attributes on logs. For now, only primitive attribute values are supported despite type declarations of
Scope.setAttribute(s)also allowing array attribute values. The reason for this limited support is that Relay still discards array attribute values. Therefore, our serialization strategy for now is:Usage Example
Some behavior notes:
closes #18159