sentry-python
sentry-python copied to clipboard
Do not trim large extra data?
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
Also related: https://github.com/getsentry/sentry-python/issues/344 https://github.com/getsentry/sentry-python/issues/335
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/
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 🥀
We are still using this currently.
What is the point of debugging with Sentry if some keys of a dictionary get trimmed?