HomeBlogTexas Ranger

Previous arcticle: Make performance great again!

Target Areas

APM covers a very wide field of topics, some of which are:

  • application code and frameworks
  • middleware
  • cloud services
  • virtual machines/runtimes like .NET runtime, Java VM, JavaScript VMs
  • dataBase engines
  • operating systems
  • network infrastructure
  • hardware

DevOps have to keep an eye on at least the top five of them.

How to measure application performance

  • Service-ortiented KPIs are about the performance of your services from the users' persepective, for example response time, availibility and mean time to repair.
  • Efficiency-oriented KPIs indicate the number of handled events or transactions per time frame.
  • The "classic" monitoring KPIs are usually resource-oriented ones like CPU and memory consumption, I/O, network load, database usage and the like.

All of those KPIs are used by software-architects for capacity-planning: How will the system cope with future growth? How many users do we expect, how many transactions per hour, how much data?

APM Use-Cases

Before we jump into Application Insights, let's examine the various APM use-cases:

  • Monitoring means watching KPIs and watermarks and reacting in case of a breach.
  • Proactive production-analysis goes a step further: Instead of just reacting, we try to anticipate what will happen based on current KPIs: If memory consumption keeps rising with the number of users, what does it mean?
  • Usage Analysis: What kind of users are using your application in which ways? What browsers are being used? From what geographic regions or locations? What pages are hit most frequently? How many parallel sessions are there?
  • Post-mortem diagnosis: Quickly triage, diagnose and pinpoint problems.
  • Profiling is a classic developer task to find out about method performance, memory usage, cpu consumption, garbage collections and other metrics.
  • Architecture validation aims at identifying anti-patterns and other problems before they create performance relevant problems under load. This is most important for architects and DevOps because it can be done early and prevents non-suitable architectures. Performance cannot be built on top of your apps, it must build the basis.
  • Performance testing comprises various ways of measuring the applications's behaviour under load.

Which use-cases does Application insights cover?

Application Insights covers all but the last use-case but there are different tools for different tasks. In this blog series we will talk about web applications.

"Application Insights components"

Status Monitor or Insights Extension

The core component is the Status Monitor resp. the Insights Extension. The first one is installed on-premises and hooks istelf into IIS. The latter is added to an azure web app automatically the first time one selects Monitor => Application Insights. Both will transfer telemetry data to azure Application Insights. Application Insights itself will always run in azure but on-prem apps can send telemetry data there. The status monitor/ai extension is essential for correlating the various parts of a transaction, e.g. ajax requests -> service call -> other service call -> database. It is also needed for exposing clear-text SQL-statements. Both, Status Monitor and Insights Extensions instrument your app at runtime without source-code modifications.

Application Insights SDK and Telemetry API

The Application Insights SDK has to be added during build time. It provides a) futher insights into you app and b) the telmetry API. With the telemetry API you can add custom telemetry events to your code, e.g. track execution time between method-entry and exit.

This is a full overview of what can be done with status monitor/ai extension or the Application Insights SDK (Image taken from: Instrument web apps at runtime with Application Insights):

"compare run- and buildtime instrumentation"

azure Service Profiler

The azure service profiler provides profiling-capabilities in a production environment. Like a dev-profiler, it uses samples of the incoming requests to identify slow methods and critical paths.

Application Insights Analytics

It provides in-depth analytics of all telemtry data gathered by the Application Insights instance. A SQL-like syntax enables performance-hunters to extract and correlate information on web requests/service calls, ajax calls etc. Creating charts from queries is also supported.

JavaScript Telemetry & API

The JS telemetry & API is used to instrument and monitor JS applications and to provide an end-to-end correlation from a user interaction down to the database.