-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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): Ensure normalizedRequest
on sdkProcessingMetadata
is merged
#14315
Open
mydea
wants to merge
8
commits into
develop
Choose a base branch
from
fn/normalizedRequestMerge
base: develop
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.
+153
−27
Conversation
This file contains 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
size-limit report 📦
|
❌ 2 Tests Failed:
View the top 2 failed tests by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
mydea
changed the title
fix(core): Ensure
feat(core): Ensure Nov 15, 2024
normalizedRequest
on sdkProcessingMetadata
is mergednormalizedRequest
on sdkProcessingMetadata
is merged
mydea
force-pushed
the
fn/normalizedRequestMerge
branch
from
November 15, 2024 09:33
e8533fa
to
cd85f65
Compare
Lms24
approved these changes
Nov 15, 2024
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.
Sounds good to me!
mydea
force-pushed
the
fn/normalizedRequestMerge
branch
from
November 18, 2024 08:39
41be6fd
to
a56fc65
Compare
mydea
force-pushed
the
fn/normalizedRequestMerge
branch
from
November 18, 2024 09:12
a56fc65
to
4705e11
Compare
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.
We keep
normalizedRequest
with data like headers, urls etc. on thesdkProcessingMetadata
on the scope.While this generally works, there are some potential pitfalls/footguns there:
One, if you put some (e.g. partial)
normalizedRequest
on the current scope, it will just overwrite the fullnormalizedRequest
from the isolation scope, where generally we'll try to put the request data automatically (e.g. in the http instrumentation). Think this example:the resulting event inside of this
withScope
callback would only have the headers, but would miss e.g. url etc. data set.This PR changes this so that the
normalizedRequest
is merged between the types of scopes, so only set fields on e.g. the current scope will overwrite the same fields on the isolation scope, instead of just overwriting the whole normalizedRequest that results.Related to this, this PR also exposes a new
setRequestEventData(normalizedRequest)
API, which is a type-safe way to set request data on the scope (defaults to isolation scope), and which will also merge the request data of the scope itself.(naming based on #14317)
So instead of:
You would do:
Alternatively, we could also leave
setRequestEventData
and a) Adjust the type ofsetSdkProcessingMetadata
to "fix"normalizedRequest
, which is kind of breaking (although very unlikely to actually affect any user, but still...), or b) Leave it untyped and generally merge this insetSdkProcessingMetadata()
, or c) do not merge it at all in these cases.Note that bundle size for browser is sadly anyhow affected (no matter if we go with a/b/c), as the code to merge it between scopes is always shared :(