Record `Exception.Data` when calling `RecordException`
See original GitHub issueFeature Request
Has there been an consideration of recording values from an exception’s Data
property as tags on the event when calling activity?.RecordException(ex)
?
Describe the solution you’d like:
I would like to add key/value data to certain exceptions beyond just a message. It would be useful to record this extra data when the exceptions are caught.
Describe alternatives you’ve considered.
The extra data can obviously be recorded manually, but it seems natural to include this functionality in the RecordException
method.
Issue Analytics
- State:
- Created 2 years ago
- Comments:14 (7 by maintainers)
Top Results From Across the Web
Errors and Exceptions
To manually record exceptions, we need to get the span from the tracer and then call a function called recordException() or recordError() which...
Read more >record_exception (Python agent API)
Python API: This call records the details of a Python exception as an error. ... Use record_exception to record any Python exception as...
Read more >Debug info for OpenTelemetry exceptions · Issue #2520
Record Exception.Data when calling RecordException open-telemetry/opentelemetry-dotnet#2439 (comment).
Read more >Exceptions
Recording an Exception An exception SHOULD be recorded as an Event on the span during which it occurred. The name of the event...
Read more >Resilience4J Circuit Breaker to kick-in on specific HTTP ...
Is there any way that we can open circuit breaker based on the status code. I see method like recordException() or recordFailurePredicate() ...
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 Free
Top 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
It would be useful if the entire exception object was available somewhere, so that it could be retrieved in a processor. Reducing an exception to its type, message, and stacktrace string makes it impossible to recreate the exception or get at values from other properties. For example
ArgumentOutOfRangeException
has anActualValue
property. Such values wouldn’t be available from theData
dictionary.Additionally, the stack trace string captured in
exception.stacktrace
is insufficient to create an actualSystem.Diagnostics.StackTrace
instance, if one wants to do anything more advanced with the frames, their IL offsets, etc. One needs the original exception - as innew StackTrace(ex)
.Need to open an issue in the opentelemetry-specification repo describing the issue and the suggested improvement.