kiwicom/structlog-sentry

Can't use format_exc_info with SentryProcessor

Closed this issue · 0 comments

The SentryProcessor as well as the structlog built-in format_exc_info processor both use event_dict.pop("exc_info", None). This means, when the built-in processor is used for nicely converting the exception into a readable traceback and the former is used to send the event and exception to Sentry, the one that comes later in structlog's processors list doesn't do anything.

I'd like to propose to change the SentryProcessor to use event_dict.get("exc_info") instead of pop() in

exc_info = event_dict.pop("exc_info", True)

The documentation should be changed such that it points out that structlog's built-in format_exc_info processor must come after the SentryProcessor.