We’re using Sentry on a Koa application on node.
I’ve just realised it’s not collecting the body of POST/PATCH/PUT requests.
In fact the breadcrumbs section only contains the exception and that’s it.
How would we go about fixing this so that more useful data is collected?
Actually, this still doesn’t completely give the right results. I played around with which property and request object to use. I found that Sentry would complain about an invalid attribute and would not capture the body in some cases.
None of these was a perfect solution. Here’s the outcome I found depending on which one I uncomment:
Raven.captureException(
err,
// req: this.request, // Sentry captures body, but flags this as an invalid attribute
// request: this.req, // No body, no invalid attribute error
// req: this.req, //No body, no invalid attribute error
// request: this.request, //No body, no invalid attribute error
);
req: this.request yielded the best result, just has an irritating message saying it’s invalid.
This also results in the url that is captured is not quite right, it’s good enough for debugging though.
Would you be able to provide the smallest possible repro-case for this issue?
Also feel free to open an issue on GitHub, as it sounds like a bug (we have to confirm it first).