Some errors are truncated which both limits the stack trace and prevents Sentry from rendering a pretty stack trace. My google-fu is failing me, I cannot find any docs about the PII rule !limit. I added send_default_pii=True to try and mitigate this but it doesn’t seem to work.
How do I get sentry SDK to send full stack traces?
A better way to deal with this particular case is to find the code that emits this error and see if you can find a way to avoid stringifying the stacktrace before logging.
For example, log.error("Exception caught: " + traceback.format_exc(...)) causes less data to be sent than log.error("Exception caught", exc_info=True)
I’m running into this issue, but when using capture_message, and in a situation where it’s not really possible to guarantee that the string is shorter. (Specifically, we have a healthcheck script that runs regularly and needs to output a lot of information when things are in a bad state. It happened to be stuck on an old version of the Python SDK, and we started getting truncated messages when I updated it.)
When digging into the implementation, I ran into this comment:
def strip_string(value, max_length=None):
# ...ommitted code here...
if max_length is None:
# This is intentionally not just the default such that one can patch `MAX_STRING_LENGTH` and affect `strip_string`.
max_length = MAX_STRING_LENGTH