Angular: Adding Application Insights (Service)

Application Insights is Microsoft's flavor of what's known as an Application Performance Monitor, or APM for short. An APM is a tool that provides insights to developers and operations (DevOps) teams into how well an application and its underlying infrastructure is performing. In general, an APM is much different than something like Google Analytics. For all intents and purposes, Google Analytics is geared more towards capturing, converting, and retaining site visitors--essentially it's a marketing tool. Application Insights, on the other hand, is a functional operations tool designed for developers and site reliability engineers.

In the previous posts, we explored two ways to add Google Analytics to an application: bundling an external JavaScript file and as a service. Those same approaches can be utilized for adding Application Insights to your Angular application. However, given the nature of Application Insights, we're going to go a little bit further into development on this post. We're going to build in some tracing that provides some better insights into how the user is interacting with our application.

All source code for this post can be found in my demo GitHub repository. You may it useful for easy reference. Additionally, this post assumes you understand how to use the Angular CLI.

Read more