sentry-python icon indicating copy to clipboard operation
sentry-python copied to clipboard

Add stack information when `stack_info` is set in logging integration.

Open antonpirker opened this issue 1 year ago • 1 comments

Problem Statement

The stack information should be added to events send with the logging integration when stack_info=True is set.

Code like this should have a stack attached in the resulting event in Sentry:

logger.error(
    "Option %s set to %s. previous update channel: %s",
    key,
    value,
    channel,
    stack_info=True,
)

Solution Brainstorm

Check for the parameter in logging integration and add the stack information if parameter is True.

antonpirker avatar Mar 12 '24 09:03 antonpirker

Some info from @untitaker :

exc_info=True should send the stack specifically, it sends the current stack if sys.exc_info is None, otherwise it sends the current exc info stack_info appears to be new in 3.2, we made the api design decisions with py2 in mind at the time

antonpirker avatar Mar 13 '24 14:03 antonpirker