Skip to content

Allow filtering/custom handling of with_locals values #217

Description

@alvinlindstam

Including locals in the stacktrace for errors can be very useful, but we've found that we'd like some more control of those values.

Example:
Calling repr on a django queryset will evaluate the query if it's not cached, which might both slow the error reporting down and even affect the database performance (if it's a costly query).

It could also be used to control which locals to include, in case we'd like to scrub some out.

The data scrubbing could be done in before_send I guess, but all values would have been evaluated already so it would not help us with expensive repr calls. And it would require us to dive into the nested(?) stacktrace data. How about having some option, similar to before_send or before_breadcrumb but for before_locals that could receive the locals and should returned some new dict as the locals?

Or is there any ideas on other way's to prevent lazy queryset evaluation in sentry, other than disabling all locals with with_locals=False?

Metadata

Metadata

Assignees

Labels

Help WantedExtra attention is needed

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions