Skip to main content

How can I retrieve truncated data in Sentry?

Issue

My error messages are truncated (shortened) in Sentry, and I see "Removed because of size limits" when I hover over the cut-off value. This is preventing me from getting vital debugging information. Can I retrieve the full data, and how do I stop it being truncated?

Applies To

  • All SaaS Customers and Self-Hosted Users

  • Data Handling

Resolution

No. Once data is truncated it cannot be retrieved, because the removed portion is discarded during event processing and never reaches Sentry. You can only prevent truncation for future events, using the options below.

  1. Increase the value length limit. Most SDKs let you raise the per-value character limit with max_value_length (named maxValueLength in the JavaScript SDK). The hard limit is 8192 characters.

    sentry_sdk.init(
    dsn="...",
    max_value_length=8192,
    )

    Do not set this higher than you need: a very large value can push the event past the 1 MiB payload limit, and Sentry drops events that exceed it.

  2. If 8192 characters is still not enough, store the data where the limits are higher. Add it to the scope as context, which allows more data than a single value. You can also add custom logic in before_send that checks the message length and, when it exceeds the per-field size limit, moves it into a context field instead.

Did this answer your question?