-
-
Notifications
You must be signed in to change notification settings - Fork 205
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
Closing Unfinished Transactions #1975
Comments
Some previous discussion on this here: getsentry/develop#443 Also relates to #1844 |
My inclination is to do two things:
We may also need to consider if we need to finish unfinished spans in the same way or not. |
For now, let's forgo the API change and just focus on closing the transaction with an error status (See 1 above). |
Probably should return sentry-dotnet/src/Sentry/SpanStatus.cs Line 56 in 19da8b8
|
Consider:
If
DoSomething
throws an unhandled exception, the transaction is never finished and thus not sent to Sentry. We should consider whether we should catch this in and finish the transactions with an error status, so that information is not lost.We could just do that in our unhandled exception handlers, or when capturing an exception that is marked unhandled (so it works with all integrations). However, that doesn't take care of this possibility:
Of course, that should probably be written as:
But we could also do that if we made it
IDisposable
, such as:... which then simplifies the original problem to:
Unfortunately, that would be a breaking change - and one that is easily missed.
An alternative API that we could add without breaking anything would be:
The text was updated successfully, but these errors were encountered: