Application Insights In Visual Studio 2015

Introduction

Microsoft is constantly introducing new improvements to Visual Studio. These modifications are very good for the developers to make web applications, web projects and many other things. The main intent of Microsoft is to provide a platform for developers to easily handle everything related to their applications. So motivated by this Microsoft always performs changes in Visual Studio depending on the developers needs and makes Visual Studio better and more reliable compared to older versions. So to make it better Microsoft has introduced a new feature known as Application Insights. It is a great thing in the history of Visual Studio.

Application Insights

Application Insights is a very important tool by which we can check the performance of our applications. Application Insights is basically a cloud based technology through which we can determine what users do with our application. Using Application Insights we can find many types of information related to our application like how many users there are, how long a specific user uses our application, in which environment they run our application, what mistakes they create during the use of the application and much more information regarding our application. Application Insights is a Microsoft cloud based technology. It is easy to add Application Insights to your web project. Application Insights increases the performance of your application. if you use Visual Studio 2015 then please note one thing that the Visual Studio 2015 Preview is only compatible with Application Insights tools 2.0 and its later versions.

We wll now discuss how to add Application Insights into our project.

There are two ways to add an Application Insights into your project. One is to add Application Insights to your new project and the other is to add Application Insights into an older project.

Add Application Insights into a new project

Step 1

Open your Visual Studio. Go to the file menu then go to New Project. Add a new website. Please ensure that you have checked the checkbox to Add Application Insights to your project.



Step 2

When you add this to your project then you see in the Solution Explorer an ApplicationInsights.Config; there are the following four files.

  • Dashboard
  • Availability Monitoring
  • Performance Monitoring
  • Usage Analytics



Step 3

When you add the Application Insights into your project then there will be two new references in the references added automatically.

  • Microsoft.ApplicatinInsights.Telementry.Services
  • Microsoft.ApplicatinInsights.Telementry.Web



Step 4

When you launch your application on the server then you can monitor your entire website or web application using Application Insights. Now to use the Application Insights in your project, right-click on your project. You will see an option for opening the Application Insights portal in options.



Step 5

When your application is running on the server and you open the application portal from options then by default in the browser and you go to the Visual Studio online/Application Insights portal then this page has many options for monitoring your entire application.page as in the following:





Now here our application has a dashboard in which there are many options to monitor our application.



Then on the given options we can explore any options according to our requirements.

Here I explore the USAGE option. In the usage option we have many options like top pages, page views, Event, Event Insights, Application version, slowest request and many others. When we click on the events then we can check out how many events are currently running in our application like in the following picture. Here we check how many activities there are and how many sessions are available and are present at the current time in our application. The graph will be changed according to the number of sessions and number of activities.



When you go to the Streaming Data then you have the information about how your application works and when users send a request to the server. Here this time the source, devloper name, event name and event durations are available so using this you can get all the information about your application status.






There is an entire summary present in the diagnostics like in the given picture.



Now there are many options by which you can check out your entire application. There you see many charts so depending on your needs you can click on your desired chart. The chart has like usage, performance, availability and much more. For more explorers click here

Add Application Insights to an existing project

If you want to add Application Insights to your existing project then it is simple. Open your project then right-click on it then go to the add Application Insights telemetry. When you do this as above there are two web references added to your project automatically that I told you about above. Now you can do the same work as you can perform a new application because now in your application you added the Application Insights. So you can monitor your application using Application Insights.

Summary

Application Insights is a very good tool provided by Visual Studio. Using Application Insights we can monitor our entire site after deployment on the server. it provides many benefits like using the Application Insights we check out how many users have visited our site, how many sessions have existed there, what is the availability of memory and we can monitor the server performance. So finally we can use this feature to play a very vital role for monitoring our application at every point of view. It may be server monitoring, exception monitoring, memory events and much more. So if we add the Application Insights into our project then we can easily check its performance at any time. I hope this article will be helpful for the use of Application Insights in your application.

Up Next
    Ebook Download
    View all
    Learn
    View all