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(...)?
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
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 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
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/).
Any plans on the fix? This really impacts the debugging experience
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/
+1 on making this configurable
+1 on making this configurable
Most helpful comment
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/).