Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Applying Telemetry Analytics using Azure Application Insight

DZone's Guide to

Applying Telemetry Analytics using Azure Application Insight

Review some important insights into the performance of your cloud stack with Microsoft's Azure Application Insight tool.

· Cloud Zone ·
Free Resource

Discover the all-in-one cloud to help teams build better software. Brought to you in partnership with DigitalOcean

"If you can’t measure something, you can’t understand it. If you can’t understand it, you can’t control it. If you can’t control it, you can’t improve it." – James Harrington

The era has now moved from cloud computing to something more. We have already developed smart apps and software addressing architectural parameters like it should be distributed, scalable, highly available, fault tolerable, light weighted etc. So, what is next?

 In the next stages, customer expectations have increased. Some questions your application would face are as follows.

  • Which feature of your app is being used the most?
  • Is the app flow as expected?
  • What is the common application function/point, the user is dropping out from?
  • How many users are impacted by an exception at one point in time?
  • What is the performance of every single page?
  • Users are from which region, device detail, browser detail?

These telemetrics and data points would provide deep insights into your application and can drive decisions about your next app development cycles. The user behaviors and patterns would provide ample insight into applications features, functions, and pages to be focused on and help the application to become more competitive.

Microsoft Azure has provided a promising feature, “Application Insight,” to accomplish this goal.

To improve our app performance continuously, we need to monitor and measure how an app is performing and the user experiences and behaviors. Only then we can improve our app and prioritize the investment accordingly.

The beauty of Application Insight is that it can be easily integrated with the Azure and other cloud provider’s applications, mobile apps and with on-premise applications. It supports multiple languages and platforms.

Application Insight supports many other platform and services like Azure cloud services, Azure functions, queues, Android, etc.

To monitor your app in production, one can log into the Azure portal and see the Application Insight telemetry, where you can set alert for anomalies.

Image title


Visual Studio 2017 already has the SDK so you can analyze telemetry both from your production runs and debugging runs on your own development machine.

Image title

Steps to Setup Application Insight in ASP.NET Website

With ASP.NET 2.0, Application Insight is provided by default in Visual Studio.

You only need to configure your instrumentation key.

1. Create an Application Insight resource in Azure portal.

Copy the instrumentation key from Essential section of Application Insight Overview

Image title2. Add the instrumentation key in your code


"ApplicationInsights":

        {

           "InstrumentationKey": "xxxxxx-xxxx-xxxx-xxxx-xxxx"

        }


3. Add instrumentation to your code

Add the UseApplicationInsights extension method from the WebHostBuilder instance in Program.cs of Asp.net core 2.0 application.


    public static IWebHost BuildWebHost(string[] args) =>

            WebHost.CreateDefaultBuilder(args)

                .UseStartup<Startup>()

                .UseApplicationInsights()

               .Build();


And it’s all set for sending telemetric data to Azure Application Insight resource.

Impact on Performance & Data Security

Don’t worry about website performance; with the integration of Azure Application Insight, there would be a very small impact on performance. The tracking call is non-blocking and moves in batch in a separate thread.

As for security, the telemetry data could send to the Azure portal by using Instrumentation Key which can be found on overview tab under the Essential section of Azure Application Insight. Without this key, nothing can be sent to your Azure account.

The data does not contain any PII. The kind of data that is collected includes webserver telemetry request, response, session, exceptions, dependencies, trace logs etc.

What data is being collected can be verified in Visual Studio Output window.

Image title

Overall Application Insight is an Azure service; data is kept on secure Azure servers. Encrypted as it moves across different data centers and uses Https to send data to the portal from SDK.

Conclusion

 In a nutshell, Application Insight is Application Performance Manager (APM) tool for monitoring performance & diagnostics. This article covers the basic features of Application Insight. The other features of Application Insight that are not covered in this article are seamless integration with DevOps pipeline, a connector with Log Analytics, interactive data analytics, Funnels & Smart Detection.

Sincere thanks for reading this reading this article. Please write your valuable opinions in the comment section.

Balance virtual machines with a healthy amount of memory tuned to host and scale applications. Brought to you in partnership with DigitalOcean

Topics:
azure cloud ,cloud ,peperformance ,application insight tool ,monitoring

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}