-
-
Couldn't load subscription status.
- Fork 1.7k
feat(integrations): Add HTTPClient integration #6500
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
Conversation
size-limit report 📦
|
9f40a03 to
0eb8748
Compare
0eb8748 to
3bbc564
Compare
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.
First pass. Already looks very good to me!
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.
One more pass, after this I think we're good :)
|
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 |
|
@onurtemizkan I completely missed the bundle size impact. Can we move this integration into the |
523ede7 to
e8fb9cd
Compare
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.