Skip to content

sys.exit(0) sets transaction/span status as internal_error #4024

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sentrivana opened this issue Feb 10, 2025 · 0 comments · Fixed by #4025
Closed

sys.exit(0) sets transaction/span status as internal_error #4024

sentrivana opened this issue Feb 10, 2025 · 0 comments · Fixed by #4025

Comments

@sentrivana
Copy link
Contributor

How do you use Sentry?

Sentry Saas (sentry.io)

Version

latest

Steps to Reproduce

sys.exit(0) is treated as an exception (because internally it is one) when __exit__ing a Span. We don't check what kind of exception we've encountered, just that there was one. And if there is one, we mark the transaction as failed (i.e., set the status to internal_error.

import sentry_sdk
import sys
import time

sentry_sdk.init(traces_sample_rate=1.0)

with sentry_sdk.start_transaction(name="txn"):
    with sentry_sdk.start_span(name="span"):
        time.sleep(2)
        sys.exit(0)

Check Sentry. See transaction status is internal_error.

Expected Result

Transaction status should be ok.

Actual Result

See above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant