Microsoft Application Insights: Top Six Features to Get a 360⁰ View of Your App

By Mitesh Patekar

For development teams, it’s critical to gain insight into how well an application is working and to be able to troubleshoot problems when they occur. Many organizations currently rely on third-party providers to get access to detailed application performance data. But the information provided by these third-party tools is often incomplete and not enough to quickly diagnose and solve problems. At the same time, it’s not easy to create your own solution to application monitoring that aggregates all relevant data and renders it in a user-friendly format.

Now Microsoft has introduced a cloud service that combines standard application performance monitoring features with usage analytics and the ability to access application telemetry data and logs. Application Insights is a service available in the Microsoft Azure Preview portal that is designed to help development teams get detailed insights into their applications’ availability, performance and usage in near real time. With Application Insights you can view your applications’ telemetry data in one place via user-friendly, interactive graphs.

Application Insights answers the following questions:

  • How well is your app performing?
  • How healthy is it?
  • How useful it is to your users?

With Application insights, an application’s telemetry data is captured, sent to the cloud for storage and processing and then rendered to the user in an interactive format via the Azure portal. Users can access customizable dashboards that track application health alongside usage metrics and app crash data. The details on the dashboard views can be filtered, searched and drilled down to an event instance for more detail or to segment data. With the detailed dashboard view you can plan specific improvements to your application over time.

A typical Application Insights dashboard looks like this:

Application_Insights_Dashboard

The Application Insights extension currently works for Azure Websites that are using .NET.  There is early support for other technologies including Node.js, PHP, Python and WordPress.

Top Six Application Insights Features

I recently test drove Application Insights and identified the following six features that I believe will be most useful for development teams.

1. Custom Events

This feature captures and analyzes key user interactions and events. An event can be a click event or any activity performed by the user. For example, you could define a custom event for a button to track the number of times a user has clicked the button.

Events can be logged to Application Insights by adding a code to track the user-defined events:

            var tc = new TelemetryClient();
                    tc.TrackEvent("SampleEvent");

2. Web Tests

After you’ve deployed a web application, you can set up web tests to monitor its availability and responsiveness. Web tests are important if your application is a website or web service that is visible on the public Internet. Tests tell you if your site goes down or responds slowly—even if it’s the carrier’s problem rather than a problem with your app.

There are two types of web tests in Application Insights:

  • URL Ping Test:  a simple test that you can create in the Azure portal which sends a ping request to the server to check its availability
  • Custom Web Test: a custom test that you create in Visual Studio and then upload to the Azure portal

The results of web tests are displayed in a graph like the one below:

Application_Insights_Web_Test

3. Metric Alerts

This feature allows you to receive alerts when any metric crosses a threshold value for some period—such as failure counts, memory or page views. For example, you could set your application server response time to a desired value and receive alerts when there is an increase in the response time beyond that value.

4. Continuous Export

With continuous export you can export the live trace logs and exception data for your app into storage. The events you see in the Application Insights portal can be continuously exported to storage in Microsoft Azure in JSON format. From there you can download your data and write whatever code you need to process and analyze it.

The continuous data exported to storage is stored in blobs by categories like Messages, Page Views, Requests, etc., with a subdirectory by date and time. Note that this feature exports live data logs to your storage account starting from the day it is configured. Thus it won’t export your past data.

5. Failure Detection

It’s important to know when your application fails as well as the cause of failure so you can act and troubleshoot easily. Application Insights uses failure telemetry data to check for the number of failed requests for a given time range. For a particular failed request you can drill down in detail and can see the causes of the exception, as in the graph below.

Application_Insights_Failures

You can also view the stack trace of a request to check the exception details. This helps to drill down to the root of the problem and troubleshoot easily.

Application_Insights_Failure_Detail

6. Diagnostic Search

Diagnostic Search is the blade in Application Insights that you can use to find and explore individual telemetry items, such as page views, exceptions, or web requests. You can also view log traces and events that you have coded.

 

Application Insights is now available for public preview. Microsoft currently has three tiers of pricing for Application Insights: Free, Standard and Premium depending on the volume of data. Pricing details can be viewed on the Microsoft Azure website:

https://azure.microsoft.com/en-us/pricing/details/application-insights/

With such powerful features and pricing tiers to fit all needs, it’s worth it to give Application Insights your own test drive.