Skip to content

Conversation

@sl0thentr0py
Copy link
Member

@sl0thentr0py sl0thentr0py commented Jan 26, 2022

Based on the discussion in #1300 and #1296.

We do a lot of truncation magic in our serializer to not send huge payloads.
In the process, we ignore if a user/framework sets a custom __repr__ on a class.
This PR lets users add a sentry_repr that will short circuit our truncation logic and pick the user defined repr.
We cannot just go with checking if __repr__ is overridden because we still want to preserve the truncation behavior for classes out there in the wild like QueryDict.

Some notes from the TSC:

  • for now this is python only because python is the only SDK with an elaborate serializer
  • and in general, this only makes sense for dynamic languages

Copy link
Contributor

@antonpirker antonpirker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link
Contributor

@vmarkovtsev vmarkovtsev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@sl0thentr0py
Copy link
Member Author

@vmarkovtsev heads up, I had to change it to __sentry_repr__ in the latest release because we had some mocking problems on our end due to this change.

@vmarkovtsev
Copy link
Contributor

Thank you for the update, very helpful!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants