sentry-python
sentry-python copied to clipboard
Request body truncated to first 10 keys.
Environment
How do you use Sentry? self-hosted/on-premise
Which SDK and version? sdk 1.0
Steps to Reproduce
Send request with json payload consisting at least 11 keys. My request_bodies i set to "always".
Expected Result
In the reuquest_body section I except to see 11 keys.
Actual Result
I see only 10 keys, the last keys is truncated. The same if I send 20 keys. Only 10 first keys are shown which can cause huge problem in debugging.
Hey @pbakiewicz , Thanks for raising the issue
We are aware of that and we intentionally truncate request body to avoid hitting server payload limits. Since when we hit that limit, the server drops the event. We are trying to increase that significantly to avoid having to trim so much of the request body, will update this issue when we have a solution
Are there any updates?
This issue has gone three weeks without activity. In another week, I will close it.
But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog
or Status: In Progress
, I will leave it alone ... forever!
"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀
Just chiming in to prevent this getting closed, as I'm also waiting on an improvement to this issue. Quite often a critical key can be missing when debugging (not sure if changing how the keys are chosen should be a separate bug), so increasing the number of keys sent to Sentry would be a win.
Multiple times I haven't been able to debug properly for same reason, some of the most important variables were missing. Please allow increase this value as on self-hosted version you can have much higher server payload limits.
:+1: Definitely a problem for us too. Would appreciate a fix for this year old issue since it makes sentry partially useless -- and why pay for a service that's not providing the intended/advertised value?
it would be nice to at least have an indication that the output was truncated when viewing it on sentry ui.
when strings are truncated we see "...", but for dicts (as far as im aware) there is no such indicator, which can lead to confusion when debugging.
I've just hit the same issue, some indication of truncation or a way to disable this would be hugely appreciated!
Any updates? Ran into the same problem.
Are there any updates on this? It really gets in the way of debugging when the value that causes the issue isn't even present in the report. This seems to go beyond dictionary keys and arrays - it is also limiting locals to only 10.
This is just a huge waste of debugging time on our end, again. It has been years now!
I notice there is time & server resources to implement very "heavy" features that I don't want, but this foundational issue sits waiting. I guess I can add expensive tracing now, and get confused in more places!
Hey! We are discussing internal how to best get rid of the trimming of the event payload, without breaking existing stuff or our servers. But this could take some time.
In the mean time you could have a look at this issue, it explains how you can change the limits of data truncated: https://github.com/getsentry/sentry-python/issues/1105
Hey @pbakiewicz @Negaihoshi @jgillard @darklow @BenHunt42 @alexjikim @libcthorne @IvarVirusiim @ebk46 @awbacker
It took quite some time, but we have now released a fix for this: https://github.com/getsentry/sentry-python/releases/tag/1.23.0
If you have set request_bodies="always"
[1] the body will not be trimmed whatsoever but sent as is to Sentry.
Hope this makes your lives a bit easier and sorry again for the inconveniences.
1: https://docs.sentry.io/platforms/python/configuration/options/#request-bodies
Thanks for this change. Are there any downsides to settings request_bodies="always"
that we should be aware of? Other than the obvious one of lots of data appearing on the issue webpage. Things like: is there an increased chance of a payload failing or getting rejected?