question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Record `Exception.Data` when calling `RecordException`

See original GitHub issue

Feature 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:open
  • Created 2 years ago
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
mattjohnsonpintcommented, Jun 5, 2023

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 an ActualValue property. Such values wouldn’t be available from the Data dictionary.

Additionally, the stack trace string captured in exception.stacktrace is insufficient to create an actual System.Diagnostics.StackTrace instance, if one wants to do anything more advanced with the frames, their IL offsets, etc. One needs the original exception - as in new StackTrace(ex).

1reaction
cijothomascommented, Aug 2, 2023

What would have to happen for the OpenTelemetry specification to change?

Need to open an issue in the opentelemetry-specification repo describing the issue and the suggested improvement.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found