-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat(tracing): Add empty baggage header propagation to outgoing requests #5133
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
Merged
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
size-limit report 📦
|
28f161e
to
4149c9d
Compare
lforst
approved these changes
May 23, 2022
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.
Great work! Good tests! Review is only nits.
packages/integration-tests/suites/tracing/browsertracing/meta/template.html
Show resolved
Hide resolved
(moved baggage types to @sentry/types)
remove no longer needed function
Co-authored-by: Luca Forstner <[email protected]>
f8eff24
to
c95af98
Compare
AbhiPrasad
pushed a commit
that referenced
this pull request
May 30, 2022
…sts (#5133) Adds the propagation of an "empty" baggage header. The word "empty" is however kind of misleading as the header is not necessarily empty. In order to comply with the baggage spec, as of this patch, we propagate incoming (3rd party) baggage to outgoing requests. The important part is that we actually add the `baggage` HTTP header to outgoing requests which is a breaking change in terms of CORS rules having to be adjusted. We don't yet add `sentry-` baggage entries to the propagated baggage. This will come in a follow up PR which does not necessarily have to be part of the initial v7 release as it is no longer a breaking change. Overall, this is heavily inspired from #3945 (thanks @lobsterkatie for doing the hard work) More specifically, this PR does the following things: 1. Extract incoming baggage headers and store them in the created transaction's metadata. Incoming baggage data is intercepted at: * Node SDK: TracingHandler * Serverless SDK: AWS wrapHandler * Serverless SDK: GCP wrapHttpFunction * Next.js: SDK makeWrappedReqHandler * Next.js: SDK withSentry * BrowserTracing Integration: by parsing the `<meta>` tags (analogously to the `sentry-trace` header) 2. Add the extracted baggage data to outgoing requests we instrument at: * Node SDK: HTTP integration * Tracing: instrumented Fetch and XHR callbacks Co-authored-by: Luca Forstner <[email protected]>
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 the propagation of an "empty" baggage header. The word "empty" is however kind of misleading as the header is not necessarily empty. In order to comply with the baggage spec, as of this PR, we propagate incoming (3rd party) baggage to outgoing requests. The important part of this PR is that we actually add the
baggage
HTTP header to outgoing requests which is a breaking change in terms of CORS rules having to be adjusted.We don't yet add
sentry-
baggage entries to the propagated baggage. This will come in a follow up PR which does not necessarily have to be part of the initial v7 release as it is no longer a breaking change.Overall, the PR is heavily inspired from #3945 (thanks @lobsterkatie for doing the hard work)
More specifically, this PR does the following things:
<meta>
tags (analogously to thesentry-trace
header)Note that there is still a lot to be done until we have a properly working baggage propagation. This PR should add much of the necessary groundwork but it is far from complete. I'm very open for improvement suggestions (also I might have missed something) and already added a few TODOs to follow up on in future PRs. We will iterate on baggage in upcoming PRs (potentially post-v7.0.0).
Also commented out lambda stuff because it's broken with the changed GH action.
ref: https://getsentry.atlassian.net/browse/WEB-925