When capturing events with exception, link to current trace
See original GitHub issueRegarding: https://github.com/getsentry/sentry-dotnet/pull/848#discussion_r582439193
If the current Span is already mapped to a different exception (via BindException
/span.Finish(ex)
), what should happen?
Also, if the current span on scope is the root transaction, but the exception is bound to some nested Span (or maybe even Span that’s not part of the bound Transaction), what should happen?
There are probably other similar edge cases.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
ExceptionDispatchInfo.Capture(Exception) Method
If the exception is active when it's captured, the current stack trace information and Watson information that's contained in the exception is stored....
Read more >Can I get a stack trace when I catch an exception (Like I do ...
NullPointerException: Attempt to de-reference a null object. Is there any way to get the full stack trace from the Exception in the catch?...
Read more >Capturing exceptions in OpenTelemetry .NET and Sentry.io
This is a bug in that has been fixed in Sentry.OpenTelemetry version 3.35.0. For full details see pull request #2515 but the TLDR; ......
Read more >Tracing API - open-telemetry/opentelemetry-specification
the Span becomes non-recording by being ended (there might be exceptions when Tracer is streaming events and has no mutable state associated with...
Read more >Bubbling and capturing
If an element has multiple event handlers on a single event, then even if one of them stops the bubbling, the other ones...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@bruno-garcia thanks, I think it’s clear now.
The second use case is already supported I believe. I will implement the first use case.
That exception was captured within the scope of the open span, which is available on the Scope. So capturing the exception can copy the scope.context.trace information into the error event. That span is not connected to error that way, we don’t need to add anything from the error into the span.
This is one use case. There’s a second:
With the snippet above, the transaction will be finished and flushed by the time the exception is rethrown. This means we’ll never know “within which span” let alone the trace that exception happened. The idea is to:
The idea is to hold that
Exception
instance in a WeakRefMap so when weCaptureException(e)
we can look up that exception by reference to get theSpan
instance.