Skip to content
This repository has been archived by the owner on Aug 14, 2024. It is now read-only.

Proposal: Response interface (analogous to the Request interface) #401

Closed
ueman opened this issue Aug 10, 2021 · 5 comments
Closed

Proposal: Response interface (analogous to the Request interface) #401

ueman opened this issue Aug 10, 2021 · 5 comments
Labels
enhancement New feature or request

Comments

@ueman
Copy link
Contributor

ueman commented Aug 10, 2021

It would be nice if an event has a response interface, just like the request interface.

An application makes a request and gets a response. This response can lead to crashes, by having data with which the application cannot work. Just knowing the request isn't as helpful as having the response as well.

This is especially useful for integrations like getsentry/sentry-dart#473 where HTTP requests can be captured as an exception if the status code is considered "bad". Example: Imaging you want to catch every status code from 400 to 499 as an exception and send it to Sentry. The responses from 400 to 499 often include hints on what's wrong with the request (wrong combination of parameter or whatnot). This information is lost because responses aren't recorded.
This in turn makes this kind of events hard to fix.

Having responses can be useful in non server applications such as mobile or desktop apps, but also for micro-services and servers which communicate via HTTP.

cc @bruno-garcia and @marandaneto because they wanted to hear my insights and learnings from getsentry/sentry-dart#473

@marandaneto marandaneto added the enhancement New feature or request label Aug 11, 2021
@marandaneto
Copy link
Contributor

it has been a topic already, I'll discuss it internally, thanks.

@marandaneto
Copy link
Contributor

marandaneto commented Aug 19, 2021

the idea is that we add a new type=http in the Contexts interface -> https://develop.sentry.dev/sdk/event-payloads/contexts/

the data structure could be the same as the Request interface https://develop.sentry.dev/sdk/event-payloads/request/

the UI should render nicely as it does for the Request interface

using the Contexts for the http type allows having multiple names eg request, response, etc... since a service might do a request to different services etc.

after everything being done, we could soft deprecate the request field too

@ueman
Copy link
Contributor Author

ueman commented Aug 19, 2021

What if I want to have a request and a response?

@marandaneto
Copy link
Contributor

thats not a problem, similar to https://develop.sentry.dev/sdk/event-payloads/contexts/#example and type=os

@marandaneto
Copy link
Contributor

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants