ApplicationInsights-dotnet
ApplicationInsights-dotnet copied to clipboard
Captured stack traces do not benefit from improvements to async stack traces added in .NET Core 2.1
Is your feature request related to a problem? Async stack traces captured by App Insights are messy and hard to read. Significant improvements have been made in this area on the .NET side of things, but the .NET AI SDK appears to have extensively custom code for capturing exception stack traces that does not benefit from these .NET improvements.
See:
- https://github.com/dotnet/runtime/issues/23837
- https://github.com/dotnet/coreclr/pull/14652
- https://github.com/dotnet/coreclr/pull/14655
- https://github.com/dotnet/coreclr/pull/15781
Describe the solution you'd like.
Stack traces captured by AI have async state machine noise removed as is the case in exception.ToString()
in .NET Core 2.1+
Is there any update on this issue? It would be nice to get better stack traces.
This issue is stale because it has been open 300 days with no activity. Remove stale label or this will be closed in 7 days. Commenting will instruct the bot to automatically remove the label.
unstale
@ascott18 Were you looking to see if ApplicationInsights SDK can simply do ex.ToString() and send the result as stack?
The OpenTelemetry based solution is doing this - i.e ex.ToString() following the OpenTelemetry convention. It is coming up as a preview release early October.
@cijothomas I'm looking for all the extra async noise to not be included in the call stack.
Example of a typical app Insights call stack:
exception.StackTrace
from an exception I just triggered (first picture, the same as what App Insights uses), versus exception.ToString()
(second picture) for the same exception which excludes all of that noise:
See how enormously more readable the second stack trace is? That's what I'd love to be reading through when I'm looking at exceptions in app insights, as opposed to the first one.
@ascott18 Thanks for confirming! Yes that will be the case with the OpenTelemetry based solution. We are not actively making new features/fixes to this repo, so its unlikely to get that fixed here. Would be great if you can use the preview version of OpenTelemetry based solution, and share any feedback! Thanks!
This issue is stale because it has been open 300 days with no activity. Remove stale label or this will be closed in 7 days. Commenting will instruct the bot to automatically remove the label.