on 19 January 19
Application Insights is an extensible Application Performance Management (APM) service for web developers. It monitors the performance and usage of your live web applications. It will automatically diagnose performance anomalies. With its powerful analytics you can detect issues/bugs and understand what users actually do with your app.
The feedback helps you to improve performance and usability. Application Insights works on a variety of platforms including .NET, Node.js and J2EE, hosted on-premises or in the cloud. Application Insights is available in the Microsoft Azure Preview portal that aids developers get detailed insights into their applications’ availability, performance and usage in real time. Developers can access applications’ telemetry data via user-friendly, interactive graphs. In this article we will see how to integrate Applications Insights into custom .net development projects:
You will need:
- Visual Studio 2013 update 3 or later versions work better
- An Azure subscription
- Sign in to your Microsoft account which you might have for Windows, Xbox Live or other Microsoft cloud services, if your team or organization has an Azure subscription, the owner can add you
When creating a new project, ensure that Applications Insights is selected in Visual Studio.
For existing projects:
You can right-click the project in Solution Explorer, and select Add Application Insights Telemetry or Configure Application Insights.
#2 - Run your app:
Now run your application with F5 and try this out: open different pages to generate some telemetry. This will display a count of the events that have been logged in Visual Studio
#3 - View telemetry:
Click open the Application Insights window in Visual Studio: Either click the Application Insights button, or right-click your project in Solution Explorer:
This view ('Data from debug session') shows telemetry generated in the server side of your app. Try out the filters, and click on any event to see more details. If there is no data, make sure the time range is correct, and click the Search icon.
In the portal
You can also see the telemetry at the Applications Insights web portal, unless you chose Install SDK only. The portal has the benefit of more in-depth analysis in terms of more charts, analytic tools, and dashboards than Visual Studio.
To access your Application Insights resource – log into the Azure portal and find it there, or right-click the project in Visual Studio.
The portal will open a view of the telemetry from your app: Click on the charts and tiles to view more details.
More detail in the portal
Live Stream Metrics shows the application metrics with almost real time latency. You can monitor the live data for your application including incoming request, outgoing request and server health.
Open the Application Insight Portal for the application, and then you will have the option to select Live Stream. You have to access Live Stream at the same time as your app – to allow them to connect. Live Stream only shows telemetry for the minute after it is sent. Make use of options like Search, Metrics Explorer, and Analytics for more historical analysis. Data may take a few minutes to populate in these places.
Search displays events such as requests, exceptions, and page views. You can filter by event type, term match, and property values. Select any event to see its properties and related events. Live Metrics Stream displays telemetry almost instantly. You can also see aggregated metrics like request and failure rates in the charts. Click any chart to view more details. You can also use the edit tag of any chart to set filters, size, and so on.
#4 - Publish your app:
You can publish your app to your IIS server or to Azure. View the Live Metrics Stream to make sure everything is working well. Telemetry will begin to build up in the AI portal and you can now monitor metrics, search your telemetry, and set up dashboards. You'll see your telemetry building up in the Application Insights portal, where you can monitor metrics, search your telemetry, and set up dashboards. Also use the powerful Analytics query language to analyze usage and performance or find specific events. You can also continue to analyze your telemetry in Visual Studio with tools such as diagnostic search and trends.
Setting up Application Insights is relatively simple and it helps developers and organizations to monitor their application performance without relying on third party feedback. In order to build successful apps, you need to measure the performance, detect, diagnose and resolve the issues as they happen. Have you leveraged the benefits of Application Insights yet? Please share your views in the comments section below.