Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure Application Insights Debugging using the Call Stack

I am trying to figure out a way to debug exceptions that I have received in Azure's Application insights. I am new to this type of debugging since I've only really dealt with bugs in Visual Studio, where an active debugger is running. However, with Application Insights, there are null reference exceptions which only provide a call stack, and no useful exception message.

Exception Message: Arg_NullReferenceException

Callstack:at SharedLibrary!<BaseAddress>+0x68d4c5 --- End of stack trace from previous location where exception was thrown --- at SharedLibrary!<BaseAddress>+0x329115 at SharedLibrary!<BaseAddress>+0x329207 at SharedLibrary!<BaseAddress>+0x34d603

Other Exceptions have messages such as Excep_FromHResult 0x800455A0, While others actually show the methods they trace back to.

Is there a way to find where these exceptions came from deciphering the callstack or Base Address or HResult?

This will be very useful in eliminating bugs in my app.

like image 739
William Bradley Avatar asked Dec 11 '15 01:12

William Bradley


People also ask

How do I debug my Azure app?

In Solution Explorer, right-click the project, and click Publish. In the Profile drop-down list, select the same profile that you used in Create an ASP.NET app in Azure App Service. Then, click Settings. In the Publish dialog, click the Settings tab, and then change Configuration to Debug, and then click Save.

How do I query Azure app insights?

In the Azure portal You can open transaction search from the Application Insights Overview tab of your application. You can also select Search under Investigate on the left menu.

How do I view debug logs in app insights?

Go to Application Insights resource in your resource group. Go to Logs under Monitoring section. Click on traces eye button to get log traces.

How do I check my application insights error?

Open the Application Insights Search telemetry window in Visual Studio. While debugging, select the Application Insights dropdown box. Select an exception report to show its stack trace. To open the relevant code file, select a line reference in the stack trace.


1 Answers

UPDATE: This is now supported by the HockeyApp telemetry stack. See: http://support.hockeyapp.net/kb/client-integration-windows-and-windows-phone/crash-reporting-for-uwp

When your application is compiled with .NET Native, the resulting binary doesn't contain all of the rich metadata that is normally available to .NET applications. (You get the same behavior if you call Environment.StackTrace when compiled with .NET Native.) We do write all of that data into the pdb file that is generated but it's not available at runtime.

The solution here is to post facto rebuild your stacks using the information from the pdb files. I know the AppInsights team had this on their backlog but it doesn't seem to have happened. We have some diagnostic tools that we're attempting to get published so you can do this re-combobulation yourself but there's a bit of a morass getting them published.

If you send a mail to [email protected] describing this issue it may help to grease some wheels.

like image 115
MattWhilden Avatar answered Sep 28 '22 11:09

MattWhilden