CHAPTER 1
If your company’s success is related to the reliability and uptime of a web application or web service, your mandatory mission is to keep track of what’s happening with it.
It is particularly important to have full control of it, which requires understanding three distinct aspects:
To achieve these points, we can use Application Insights, a service available on the Microsoft Azure platform.
With Application Insights, we can monitor every kind of web application, even if it is a web portal or a web service.
The technology or programming language used to develop the web application being monitored is not relevant, since many SDKs are available. This means we can cover every possible combination.
An important thing to know about Application Insights is that we can monitor web applications or services regardless of their hosting. This means we can use Application Insights to check the health of our ASP.NET-based web app hosted on Microsoft Azure in the same manner as a PHP website hosted on an Apache web server.
So, although this service is part of Microsoft Azure, we do not need to host our web application on it to use Application Insights.
This kind of service is not new; there are a lot of other services like this on the web, usually known as web analytics software (WAS).
Within this classification, you will find other software tools such as Google Analytics, Matomo (formerly Piwik), Statcounter, and many others.
In any case, the official classification from Microsoft’s documentation about Application Insights is Application Performance Management (APM).
In the end, however it has been classified, the sense of this service will not change: it is a telemetry service.
Note: Telemetry is an automated communications process by which measurements and other data are collected at remote or inaccessible points and transmitted to receiving equipment for monitoring. (Source: Wikipedia)
The first time I heard about telemetry was while watching a Formula 1 car competition. At that time, the speaker mentioned that with this technology the racing team was able, in every moment of the race, to control all the vital parameters of the car, such as tire pressure, fuel level, brake efficiency, engine temperature, and so on. All these values appeared on the team manager’s screen as a real-time flow of data, on grids or charts.
Let me explain why, from my point of view, this is a similar scenario to a web application. Suppose you are leading a racing team (your company), you have a speedy and affordable car (your product), and you hire a professional driver (your development team) to win the race against your competitors (the market).
You need telemetry, you need that flow of data, to understand in real-time the changes that happen in order to evaluate the race’s status and the conditions in which your car is running, applying the necessary corrections to achieve the best performance, or reach the finish line.
If you miss or don’t correctly evaluate this information, your car’s engine could break in the middle of the race, or something else could happen, and it may never reach the finish line.
This service was born a few years ago. In its first version it was part of Team Foundation Services Online (today known as Visual Studio Team Services), and its main scope was to provide telemetry not only for web applications, but also mobile apps.
After a while, the service became part of Microsoft Azure, and now, the focus of this service has been limited to web applications.
In the first half of 2016, a telemetry service specifically targeted toward mobile apps was created. This service is called HockeyApp.
A few months later, Microsoft announced the availability of the HockeyApp Bridge App. It enables you to access data collected by HockeyApp in Application Insights through its Analytics and Continuous Export feature.
As previously stated, availability, performance, and usage of our web application (or service) are the three most important goals for Application Insights.
But behind these three goals are more aspects to consider, which we will cover here.
When we monitor availability, we would like to understand:
Let me give an example: we have a company that produces short pants, and we want to sell these pants through a web commerce site throughout the world. The servers that host this website are based in Ireland.
Given the nature of the product, we will sell more in the hottest season of the year, but the season changes depending on the continent. For this reason, we can watch for the amount of time that a user from the hottest side of the globe takes to reach our website.
Starting from this data, we could discover that:
Keeping this in mind, we can opt for a geographical replication of our website in a more easily reachable location for our potential customers, such as Japan.
This kind of decision is so easy in the cloud era, where a webmaster can simply modify geo-replication with a couple of clicks and get it sorted in a few minutes. But is important to know where to invest your money for your business, since geo-replication can be inexpensive, but in the end, it’s not free.
Using the web commerce site scenario, we should investigate the performance of our site to give our potential customers the best user experience.
In our example, we should be able to determine what pages or functions in our website slow our catalog search. Maybe we can discover a bottleneck in our search algorithm or in an external service we have integrated into our platform.
In our investment plan, we must estimate the effort (regarding money and time) to determine the best direction to achieve the business growth we are expecting.
To reach this goal, we need to understand the usage of our website, meaning how users spend their time on it. For instance, we should know if they prefer to search the catalog using filters, or browse the photo gallery more than the product detail page, or when they have found an active promotion on the main page whether or not they visit the promotion page.
This data can influence a large part of our future investments. To give an example, if we understand that our visitors usually appreciate a page we have underestimated, we can invest in the enhancement of that page or feature, instead of reinvesting in another, more expensive, and less attractive page for our potential customers.
In this book, we will journey through the features available for the Application Insights resources. We will not cover all of them, but it will be a good starting point to understand the power of Application Insights.