-
Notifications
You must be signed in to change notification settings - Fork 50
[RUM-10500] [V3] Attributes encoding and validation #1008
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
Draft
marco-saia-datadog
wants to merge
4
commits into
feature/v3
Choose a base branch
from
marcosaia/RUM-10500/v3-context-validation
base: feature/v3
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
[RUM-10500] [V3] Attributes encoding and validation #1008
marco-saia-datadog
wants to merge
4
commits into
feature/v3
from
marcosaia/RUM-10500/v3-context-validation
Conversation
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
d9f921e
to
68036d3
Compare
68036d3
to
a4725c4
Compare
sbarrio
reviewed
Oct 13, 2025
packages/core/src/sdk/AttributesEncoding/__tests__/attributesEncoding.test.ts
Show resolved
Hide resolved
sbarrio
reviewed
Oct 13, 2025
sbarrio
reviewed
Oct 13, 2025
sbarrio
reviewed
Oct 13, 2025
sbarrio
previously approved these changes
Oct 13, 2025
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.
Left some minor comments. Good work!
Thanks @sbarrio 🙌 I have addressed your comments in a new commit. I still have to do some further manual testing before merging this. After I am done, I will squash the commits and merge this in v3 :) |
sbarrio
approved these changes
Oct 14, 2025
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.
What does this PR do?
Starting from v3, we are changing the way attributes are handled to improve safety, consistency and compatibility with native SDKs, and to support more attribute typesl
What’s New
Date
,Error
, andMap
are properly serializeda.b.c = value
), matching the format expected by native SDKs and avoiding ambiguous outcomes.context
key to maintain schema consistency.Motivation
In React Native, it’s common for developers to pass complex objects as attributes (e.g. partial or full Redux/Zustand state, raw
Error
objects). These may contain unserializable values that would break serialization. While ideally users should only pass clean dictionaries of encodable values, in practice they expect the SDK to handle arbitrary objects to some extent.This change ensures:
Example Transformations
"foo"
→{ context: "foo" }
{ user: { profile: { name: "Alice" } } }
→{ "user.profile.name": "Alice" }
new Error("Boom")
→{ "context.name": "Error", "context.message": "Boom", "context.stack": "...", ... }
new Map([["k1", 1], ["k2", "v2"]])
→Unsupported values like
Symbol("x")
or() => {}
→{}
(dropped with warning)Benchmarks