Application and App Monitoring with Microsoft Application Insights


The Visual Studio team recently released an application monitoring tool called Application Insights (preview) for Visual Studio Online. If you have an Azure account with subscription for Visual Studio Online, you can request a limited preview of the Application Insights platform, that allows you to monitor the performance, availability, usage and diagnostic aspects of not just web, but services, Windows Phone, Windows Store, and Azure PaaS based applications and apps.

Configuring Application Insights (On Premise)

Application Insights primarily consists of the Monitoring Agent that you need to install for on premise Windows Servers. During installation, you need to specify the Account Id, and the Instrumentation Key. The Agent installer provides three options. Use the Application Insights for Visual Studio Onlineoption to surface the monitoring data of your applications on premise to be collected and analysed in Visual Studio Online.

Figure 1: Monitoring Agent Setup

Note that, IIS Management Tools and Scriptsis a pre-requisite for installing the monitoring agent.

Configuring Application Insights (Azure PaaS)

For Windows Azure PaaS based applications, you need to modify the deployment configuration files in your Windows Azure project. A step by step guide is provided, if you select Add an Applicationfrom the Application Insights page under Visual Studio Online. Answer the questions presented by the Wizard as shown in Figure 2, and you will reach the step by step instructions.

Figure 2: Wizard Driven Interface to Add a New Application for Monitoring

You will need to download the instrumentation tool and extract the files to be placed into the AppInsightsAgentfolder inside your web role. You then need to add a Startup Task to launch the instrumentation bootstraps (unifiedbootstrap.bat file). Deploy the application, and the metrics will start showing up in the site.

Measuring Availability with Synthetic Monitors

Application Insights allows you to provide the application URL as a ping request that can then monitor performance, availability and functionality using the tool called Synthetic Monitor. You can create multiple synthetic monitors, and create a single URL test, or a multi-step test using a Visual Studio Web Test file as shown in Figure 3.

Figure 3: Multi-step Synthetic Monitor

Analysing Usage with Telemetry SDK

The Telemetry SDK with Application Insights allows you to surface usability patterns of the deployed application. You can download the Telemetry SDK using NuGet and then start using the ServerAnalytics.Start method to allow Application Insights to start capturing usage data.

using Microsoft.ApplicationInsights.Telemetry.Services; public override bool OnStart() {    ServerAnalytics.Start("");     return base.OnStart();}

The above code sample, demonstrates enabling the analytics on a Worker Role.

You can also use the SDK to log KPIs for important events occurring inside your application. The method ServerAnalytics.CurrentRequest.LogEvent will help you log events and surface them under Feature –> Events in the Application Insights site.


The Application Insights portal also lets you diagnose issues and exceptions as they are recorded by the monitoring agent. You can navigate to the Diagnostics page and see the events as they occur as illustrated in Figure 4.

Figure 4: Diagnostics using Application Insights


Application Insights is a very promising and powerful utility to monitor the performance, function and usability of a wide range of applications and apps, and the journey that started from IntelliTrace finally seems to have unified the application monitoring and diagnostics experience under one roof.

Share the Post:
Share on facebook
Share on twitter
Share on linkedin


The Latest

homes in the real estate industry

Exploring the Latest Tech Trends Impacting the Real Estate Industry

The real estate industry is changing thanks to the newest technological advancements. These new developments — from blockchain and AI to virtual reality and 3D printing — are poised to change how we buy and sell homes. Real estate brokers, buyers, sellers, wholesale real estate professionals, fix and flippers, and beyond may

man on floor with data

DevX Quick Guide to Data Ingestion

One of the biggest trends of the 21st century is the massive surge in internet usage. With major innovations such as smart technology, social media, and online shopping sites, the internet has become an essential part of everyday life for a large portion of the population. Due to this internet

payment via phone

7 Ways Technology Has Changed Traditional Payments

In today’s digital world, technology has changed how we make payments. From contactless cards to mobile wallets, it’s now easier to pay for goods and services without carrying cash or using a checkbook. This article will look at seven of the most significant ways technology has transformed traditional payment methods.