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

Do not trim large extra data?

Open decaz opened this issue 5 years ago • 10 comments

Version 0.8.0 introduced trimming of large data. Is it possible to optionally not to trim extra data which I specify with scope.set_extra(...)?

decaz avatar May 29 '19 08:05 decaz

That's not possible right now, but for now you can monkeypatch these two constants if you need to: https://github.com/getsentry/sentry-python/blob/e9a469be8f8589d3e97efdf870044216fd5680cb/sentry_sdk/serializer.py#L29-L30

untitaker avatar May 30 '19 19:05 untitaker

Also related: https://github.com/getsentry/sentry-python/issues/344 https://github.com/getsentry/sentry-python/issues/335

untitaker avatar May 30 '19 19:05 untitaker

I have tried monkey patching but still I get a log message that is 512 characters.

# Monkey patch to increase log message limit
from sentry_sdk import utils

utils.MAX_STRING_LENGTH = 10000
utils.slim_string.__defaults__ = (10000,)

Siecje avatar Aug 06 '19 19:08 Siecje

@Siecje seems there's some rotten code in that file, you need to do the same defaults dance for utils.strip_string, which seems to be duplicated logic

# Monkey patch to increase log message limit
from sentry_sdk import utils

utils.MAX_STRING_LENGTH = 10000
utils.slim_string.__defaults__ = (10000,)
utils.strip_string.__defaults__ = (10000,)

I will refactor this to only use one function, and make it so that you only have to set the constant. Sorry for the inconvenience

untitaker avatar Aug 07 '19 10:08 untitaker

I'm monkey-patching this, but it would be great if the size of the extra data follows what is described in the Data Handling section of Sentry Docs (https://docs.sentry.io/development/sdk-dev/data-handling/).

fmors avatar Mar 05 '20 15:03 fmors

Any plans on the fix? This really impacts the debugging experience

DataGreed avatar Jul 28 '20 15:07 DataGreed

I'm monkey-patching this, but it would be great if the size of the extra data follows what is described in the Data Handling section of Sentry Docs (https://docs.sentry.io/development/sdk-dev/data-handling/).

New url for the docs: https://develop.sentry.dev/sdk/data-handling/

dromer avatar Nov 02 '20 19:11 dromer

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 Dec 23 '21 15:12 github-actions[bot]

We are still using this currently.

dromer avatar Dec 23 '21 17:12 dromer

What is the point of debugging with Sentry if some keys of a dictionary get trimmed?

wieczorek1990 avatar Sep 07 '22 10:09 wieczorek1990