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

Exception attributed to previous transaction

Open sentrivana opened this issue 1 year ago • 4 comments

How do you use Sentry?

Sentry Saas (sentry.io)

Version

1.21.1

Steps to Reproduce

  1. Create a virtual env, activate it, and install sentry_sdk.
  2. Create a minimal app.py with this:
import sentry_sdk
from sentry_sdk import start_transaction

sentry_sdk.init(
    dsn="<add_me>",
    debug=True,
    traces_sample_rate=1.0,
)

with start_transaction(name="my_transaction"):
    pass

raise ValueError('Oh no!')
  1. Run app.py.
  2. Find the event in Sentry.

Expected Result

The Sentry error event has no transaction tag since my_transaction has already concluded by the time the exception occurred.

Actual Result

The Sentry error event has a transaction tag with my_transaction attached.

Screenshot 2023-05-03 at 09 32 52

sentrivana avatar May 03 '23 07:05 sentrivana