Skip to content

Exception attributed to previous transaction #2064

@sentrivana

Description

@sentrivana

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions