sentry-python icon indicating copy to clipboard operation
sentry-python copied to clipboard

Request body truncated to first 10 keys.

Open pbakiewicz opened this issue 3 years ago • 7 comments

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.

pbakiewicz avatar Mar 04 '21 10:03 pbakiewicz

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

ahmedetefy avatar Mar 05 '21 10:03 ahmedetefy

Are there any updates?

Negaihoshi avatar Aug 06 '21 08:08 Negaihoshi

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 🥀

github-actions[bot] avatar Jan 10 '22 18:01 github-actions[bot]

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.

jgillard avatar Jan 10 '22 19:01 jgillard

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.

darklow avatar Feb 23 '22 21:02 darklow

:+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?

BenHunt42 avatar Mar 17 '22 14:03 BenHunt42

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.

alexjikim avatar Sep 19 '22 21:09 alexjikim

I've just hit the same issue, some indication of truncation or a way to disable this would be hugely appreciated!

libcthorne avatar Oct 14 '22 16:10 libcthorne

Any updates? Ran into the same problem.

IvarVirusiim avatar Oct 24 '22 13:10 IvarVirusiim

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.

ebk46 avatar Feb 27 '23 15:02 ebk46

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!

awbacker avatar Mar 30 '23 04:03 awbacker

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

antonpirker avatar Apr 03 '23 12:04 antonpirker

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

antonpirker avatar May 15 '23 13:05 antonpirker

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?

jgillard avatar May 16 '23 10:05 jgillard