Questions? Feedback? powered by Olark live chat software
Hopp over navigasjon

Azure Diagnostics integration with Application Insights

Posted on 18 november, 2015

Senior Program Manager, Cloud + Enterprise

If your Azure cloud service is responding slowly, you’d probably like to know if there’s a CPU or memory bottleneck, or if it fails unexpectedly or doesn’t start, you’d like to see the system logs. With Azure SDK 2.8, we’ve brought Azure Diagnostics telemetry into Application Insights, for Azure Cloud Services projects and Azure Windows VMs. Perf counters, Windows event logs, and app traces will all be displayed alongside the response times, dependencies and other events sent from inside your app by the Application Insights SDK.

Overview Blade

Set up an Application Insights resource

If you haven’t yet added Application Insights SDK to your Cloud Services app, do that now. Or, if you just want to see Azure Diagnostics data on its own, create a new Application Insights resource in which to display it.

Send Azure Diagnostics to Application Insights

If you haven’t published your Cloud Service project yet:

  • In Solution Explorer, open the Properties of each web or worker role (the role, not the project).
  • Check Send diagnostics data to Application Insights.
  • Select the Application Insights resource for your app.
  • Publish the service.

If your Cloud Service or Virtual Machine is already running:

  • In Server Explorer or Cloud Explorer, right-click the Cloud Service or Virtual Machine and select Enable/Update Diagnostics.
  • Check Send diagnostics data to Application Insights.
  • Select the Application Insights resource for your app.
  • Apply the updates.

Send Azure Diagnostics to Application Insights

 

View Azure Diagnostics data in the Application Insights portal

The diagnostic telemetry will show up in the Application Insights portal.

  • Windows Event Log
    • Use Search to investigate individual events.
    • Use Metrics Explorer to see counts of different types of event. Select the Azure Diagnostics Events metric, which appears under the Custom category.
  • Application traces and ETW traces: Use Search to find and inspect log traces.
  • Performance counters: Open the Servers tile from the overview blade, or create your own charts of them using Metrics Explorer or Application Insights Analytics. The Available Memory and % Processor Time performance counters can be found under the Performance Counters category, while others can be found under Custom Metrics.

View Azure Diagnostics telemetry in Application Insights

Using the combined diagnostics

Azure Diagnostics and Application Insights SDK provide complementary views of your live application. Azure diagnostics provides the system perspective, performance counters, role lifecycle data and other Windows events, while the SDK sends data from inside your app, about requests, exceptions, dependencies, and any custom telemetry you add.

As we’ve seen, each is switched on by a single option, and you can send the data streams to the same resource in the Azure portal. They’re easy to set up, and the combination of the two streams provides great diagnostic value.

We see a few scenarios where you’ll particularly value this combination:

  • Poor performance: You’ll see system events and performance data to help diagnose the issue.
  • Role crashes, recycles or failure to start – the role lifecycle data is invaluable for identifying this type of problem.

By seeing all the data in one place, you don’t have to log in to your VM or go somewhere else to find the event logs – it’s all there where you can correlate app and system telemetry.

Please share your ideas for new or improved features on the Application Insights User Voice page and for any questions visit the Application Insights Forum.