feat(integrations): Add HTTPClient integration#6500
Merged
Conversation
Contributor
size-limit report 📦
|
9f40a03 to
0eb8748
Compare
0eb8748 to
3bbc564
Compare
lforst
reviewed
Dec 21, 2022
Contributor
lforst
left a comment
There was a problem hiding this comment.
First pass. Already looks very good to me!
lforst
reviewed
Dec 22, 2022
lforst
reviewed
Jan 3, 2023
Contributor
lforst
left a comment
There was a problem hiding this comment.
One more pass, after this I think we're good :)
Contributor
|
we need to discuss this bundle size bump and why it is so much on the CDN, if we can get a strategy to reduce it |
Contributor
|
@onurtemizkan I completely missed the bundle size impact. Can we move this integration into the |
523ede7 to
e8fb9cd
Compare
lforst
approved these changes
Jan 5, 2023
This was referenced Jan 5, 2023
Merged
8 tasks
3 tasks
3 tasks
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.
Resolves: #6282
Implemented
HTTPClientintegration for@sentry/browserSDK.Implementation Guide
Response Context Spec
This integration intercepts Fetch API and XHR requests to get the response (and request) information, and creates / captures events if there is a failed (according to the user's configuration) request.
Summary:
XMLHttpRequestandfetchutilities, which can also be wrapped by other Sentry - non-Sentry utilities before or after it.cookieandheadercollection for bothrequests andresponses is the best effort. Certain headers may be missing here in the integration-created event, even if they exist in the original request / response.body_sizeis calculated only if theContent-Lengthheader is available in response headers.fetch-specific Notes:bodyinsideevent.requestobject is not implemented here. It's not available at all for XHR requests, but here it's possible. Size limits and when to leave it out should be discussed, if we are including it.Requestobject from arguments of thefetchfunction. Not sure if there are any concerns about performance, but this is the most straightforward way I could find to replicate the originalrequestobject.requestand nativeresponseobjects are added to the event ashints, as described in the spec.XHR-specific Notes:XHRrequests. We're interceptingsetRequestHeadermethod, which is only used for user or library-defined headers. And settingCookiewithsetRequestHeaderis not allowed in browsers. due to security reasons.requestandresponseobjects forXHRrequests, so events created from failed XHR requests, do not contain hints.