-
Notifications
You must be signed in to change notification settings - Fork 510
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
AIOHTTP: Attach request body #220
Comments
Any solutions here? |
@sivakov512 no, I would prefer if the community investigated how other code deals with aiohttp for reading bodies twice |
@untitaker |
@untitaker
|
@EasyLovv that sounds a bit dangerous. I wonder if we should just grab |
@untitaker yeah, it is also an option, would be great to have at least that. But in my view, I can't see anything dangerous, we are just reading the request body, any unsupported behavior or type could be covered by try-catch and posted to sentry with some additional "Unsupported body" tag etc. |
@EasyLovv my issue is that I need the request body as string in the processor. I can't just spawn a task and return. So I block for |
@EasyLovv do you want to make a PR for this so people can try it out? |
In case it's of any interest or help to anyone else, I have a fulling working aiohttp-sentry integration implemented as middleware, see here. Also aio-libs/aiohttp#3557 and aio-libs/aiohttp#3767 mean that with aiohttp 4 all error logging will possible in access loggers without adding middleware or messing with the nuts and bolts of running servers. |
The integration takes extra precautions to not make scope data leak across request boundaries. Your middleware avoids this issue by assembling the entire event payload before calling I would really like the work for request bodies to land in the SDK, but possibly hidden behind an option (kwarg to the integration object). |
Methods for reading the request body are async in AIOHTTP, but event processors are not. So right now we can't attach any request bodies to the event without severely affecting perf.
The text was updated successfully, but these errors were encountered: