Skip to main content

[Python] How to increase the amount of data shown in stack trace's variables and other fields?

Updated over a month ago

Issue

The number of entries in my stack trace variables, arrays, objects and request information is limited to 10. How can I increase it?

Applies To

  • Python SDK

  • All plans, including self-hosted

Resolution

The Python SDK limits the depth and breadth of data added to events. Both can be increased with the following code:

import sentry_sdk
import sentry_sdk.serializer

sentry_sdk.init(
โ€ฆ
)

sentry_sdk.serializer.MAX_DATABAG_DEPTH = 15 #defaults to 5
sentry_sdk.serializer.MAX_DATABAG_BREADTH = 20 #defaults to 10
Did this answer your question?