How does sentry gets access to request body in the asgi middleware?
See original GitHub issueHello, I was reading through the asgi middleware and it’s not clear to me: how is the request data (i.e. the json payload of a POST request, for example) accessed to be sent by sentry, since all that’s accessible there is the scope
, passing receive
and send
downstream?
Thank you!
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
ASGI - Sentry Documentation
Request data is attached to all events: HTTP method, URL, headers. Sentry excludes raw bodies and multipart file uploads. · Each request has...
Read more >Problem accessing to the request body after configure Sentry ...
When the Sentry implementation is active, the body = await request.body() line hangs and never response. Additional Info. This answer has more ...
Read more >Middleware - Starlette
The middleware above is the most basic ASGI middleware. It receives a parent ASGI application as an argument for its constructor, and implements...
Read more >Advanced Middleware - FastAPI
Handles GZip responses for any request that includes "gzip" in the Accept-Encoding header. The middleware will handle both standard and streaming responses. ...
Read more >tiangolo/fastapi - Gitter
Trying to enable the ASGI middleware.. and im not understanding the problem. ... while having a body in a get is discouraged, it's...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Unfortunately I don’t think this is possible in a memory-efficient way. In framework integrations we can piggyback on the in-memory buffering of the framework itself but in a middleware we would have to wrap the bytestream and keep our own copy, which is expensive.
https://github.com/getsentry/sentry-docs/pull/3393