-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Ability to add response body to httpClientIntegration #12544
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
Comments
Hey, thanks for writing in. Sadly, capturing payloads like this is relatively complex, there are a bunch of edge cases etc. to handle when trying to solve this generically 😬 So instead, what would you think about adding a new option to the httpClientIntegration that allows to configure a callback where you can do stuff yourself, e.g.: httpClientIntegration({
beforeCaptureEvent(event, data) {
if(data.xhr.response) {
// put response on event...
} else if (data.fetch.response) {
// put response on event...
}
}
}) |
I think this would be very valuable to add as an opt-in option. |
I think that would be fine as well, I have currently implemented it by making a custom |
I'll put this in our backlog as something todo - we are pretty busy right now, so PRs are always welcome as well! :) |
I like this idea, since it would allow to pass only certain error detail fields to Sentry to avoid accidentally sending private information which should not be sent. One question: could we use the Sentry's EDIT: We would need async function to access the body of the response so maybe the new |
We will likely not add a callback for anything because that is too much API surface but a flag that will attach response bodies to events. |
That would be great. If I create a PR for this would it have a high change to get merged? If yes I'd like to get some guidance where in the events you would like to see the flag and response body added. |
Problem Statement
It would be very useful to have the response body for errors, because it mostly gives more explanation what caused an error.
Solution Brainstorm
Add two extra options to
httpClientIntegration
:The text was updated successfully, but these errors were encountered: