Application Insights in Azure: The Flight Recorder for Your Running Software

Application Insights in Azure: The Flight Recorder for Your Running Software

An intermediate, plain-English guide to Application Insights — what telemetry it collects, how data travels from your code to Azure Monitor, how to trace a request across many services, how to alert on trouble, and how to keep both cost and privacy under control while the tooling moves toward OpenTelemetry.

When an aircraft lands safely, nobody thinks about the flight recorder. When something goes wrong, that small box becomes the most valuable object on the plane, because it holds the story of what the machine was doing, second by second. Running software needs the same thing. Without it, a customer complaint such as “the checkout page was slow yesterday afternoon” leaves your team guessing. With it, you can open the recording, find that exact moment and see which call to which database took too long. Application Insights is that flight recorder for applications running in Azure and beyond.

In this guide we will go step by step through what the service collects, how the data flows, how the different investigation tools work, how to set up alerts that help rather than annoy, and how to manage cost and privacy. We will also be clear about how the instrumentation story has changed recently, because the recommended way to feed Application Insights is no longer what most older tutorials describe.

1What Application Insights Is and Why It Exists

You cannot fix what you cannot see.

Modern applications are rarely a single program on a single machine. A typical web shop might involve a browser, a front-end web service, several back-end services, a database, a cache, a payment provider and a message queue. When a user clicks a button and waits too long, the delay could hide in any of those places. Observability is the ability to understand what is happening inside such a system by looking at the data it produces, and telemetry is the name for that data: requests handled, calls made, errors thrown, timings measured and messages logged.

Application Insights is the application performance monitoring capability of Azure Monitor. It collects telemetry from your application, stores it, and gives you tools to search it, chart it, trace requests end to end, detect problems automatically and send alerts. It works for web applications and back-end services written in many languages, running in Azure, on premises or in other clouds.

It answers a handful of everyday questions that every team asks. Is the application up? Is it fast enough? Which pages or operations fail most? Where is the time going inside a slow request? What are users actually doing? Which dependency is dragging everything down? Without a tool like this, answering any of them means reading raw log files on several machines, which does not scale.

Simple Analogy

Imagine a delivery company. Customers only care whether the parcel arrives on time, but the manager needs to know where each parcel was scanned, how long it sat in each depot and which truck broke down. Application Insights is the tracking system that scans every parcel at every stop and lets the manager follow any single delivery from start to finish.

Monitoring versus debugging

People sometimes treat it as a debugging tool, and it certainly helps with that. But its larger value is operational. It tells you about problems before customers complain, shows trends over weeks, and gives product teams evidence about how features are used. Think of it as three tools in one: a health monitor, an investigation microscope and a usage report.

Telemetry
requests, calls, errors, metrics and logs
Tracing
follow one request across many services
Alerts
be told about trouble before users are

2The Big Picture: Where It Fits in Azure Monitor

Application Insights is a feature of Azure Monitor, not a separate island.

Azure Monitor is the umbrella platform for collecting and analysing data about Azure resources, operating systems and applications. Application Insights is the part focused on the application layer. Understanding how the pieces relate removes a lot of confusion, especially around where your data actually lives and how it is billed.

Piece 1

Your application

The code that produces telemetry. It can be a web app, an API, a background worker, a function or a browser page.

Piece 2

The instrumentation

The agent, library or distribution that watches your app and sends telemetry. Today this is usually OpenTelemetry-based.

Piece 3

The Application Insights resource

The Azure resource that receives data through a connection string and offers the investigation screens.

Piece 4

The Log Analytics workspace

The store where the telemetry is actually kept as queryable tables. Application Insights resources are workspace-based.

flowchart LR
  A["Your application"] --> B["Instrumentation: agent or OpenTelemetry"]
  B --> C["Ingestion endpoint using connection string"]
  C --> D["Application Insights resource"]
  D --> E["Log Analytics workspace"]
  E --> F["Investigation tools: maps, failures, performance, search"]
  E --> G["Queries, workbooks and dashboards"]
  E --> H["Alerts and action groups"]
        
FIG 1 — The path of telemetry from code to insight

Notice that the workspace sits in the middle of everything. Because telemetry lands in a Log Analytics workspace, you can query it together with data from other Azure services, apply the same retention and access rules, and build combined dashboards. Older, so-called classic Application Insights resources that kept data in their own separate store have been retired in favour of this workspace-based design.

i
Remember

The Application Insights resource is mostly a front door and a set of screens. The real storage, retention and much of the billing belong to the Log Analytics workspace behind it.

3Core Concepts You Must Know

A small vocabulary unlocks every screen and every query.

Application Insights organises what it collects into a handful of telemetry types. Each one answers a different question. Learn them once and the portal, the documentation and the query tables will all make sense.

Type 1

Request

A call that your application received and handled, such as a web page load or an API call, with its duration and result.

Type 2

Dependency

A call that your application made to something else, such as a database, another service or a storage account.

Type 3

Exception

An error that was thrown or caught, with its type, message and the trail of calls that led to it.

Type 4

Trace

A log message written by your code, useful for narrating what happened at a given moment.

Type 5

Metric

A number measured over time, such as processor use, memory, queue length or requests per second.

Type 6

Custom event

A business moment you choose to record, such as “order placed” or “report exported”.

Type 7

Page view

A browser-side record of a page being shown, with load timing, collected by the browser monitoring script.

Type 8

Availability result

The outcome of a scheduled test that checks from outside whether your application responds.

Four words that glue telemetry together

Operation ID

A shared identifier stamped on every piece of telemetry that belongs to one end-to-end request. It is the thread that ties a request, its dependency calls and its exceptions together.

Cloud role name

A label saying which component produced the telemetry, such as “web-frontend” or “payments-api”. It decides how boxes are named on the application map.

Cloud role instance

Identifies the specific machine or container instance, helping you spot one unhealthy instance among many.

Connection string

The setting that tells your instrumentation where to send data. It replaced the older bare instrumentation key as the way to point an application at a resource.

!
Common Misconception

People often assume a metric and a log are the same thing. A metric is a compact number sampled over time and is cheap and fast for charts. A log or trace is a detailed record of one event and is better for explaining why something happened.

4Architecture and Components

What you run, what Azure runs and what sits in between.

Viewing the solution as a chain of cooperating parts helps you decide where to look when data is missing, late or too expensive. The table below separates the responsibilities.

ComponentResponsibilityWho operates it
Instrumented applicationProduces requests, dependencies, exceptions, traces and metricsYour team
Instrumentation layerCollects, enriches, samples and batches telemetry before sendingLibrary authors, configured by your team
Ingestion endpointReceives telemetry over a secure connection and routes it to the right resourceAzure
Application Insights resourceHolds settings, identity, sampling and the investigation experienceYou configure, Azure hosts
Log Analytics workspaceStores data in tables, enforces retention, access and billing tiersYou configure, Azure hosts
Analysis toolsApplication map, failures, performance, search, workbooks, live metricsAzure
AlertingEvaluates rules and triggers notifications or automated actionsYou configure, Azure runs

Two storage styles for similar data

Telemetry can be analysed in two forms. Logs keep every individual record in tables that you query with a powerful query language. Metrics are pre-aggregated numbers stored in a fast time-series database. Standard charts of things like request rate and failure rate can draw on metrics for speed, while detailed investigation uses logs. Knowing which style a screen uses explains why a chart can be near real time while a detailed query takes longer.

Simple Analogy

Logs are like the full CCTV footage of a building: every detail is there, but finding something takes searching. Metrics are like the visitor counter at the door: a quick running total that is instant to read but cannot tell you who walked in.

5Internal Working: The Life of One Telemetry Item

From a user’s click to a row you can query.

Following one piece of telemetry from creation to analysis shows where delays, losses and costs can arise. The path is shorter than you might fear, but each step has its own behaviour.

sequenceDiagram
  participant User
  participant App as Instrumented application
  participant Inst as Instrumentation layer
  participant Ing as Ingestion endpoint
  participant LA as Log Analytics workspace
  participant Tool as Portal tools and alerts
  User->>App: Sends a request
  App->>Inst: Request and dependency calls observed
  Inst->>Inst: Add context, apply sampling, batch items
  Inst->>Ing: Send batch using connection string
  Ing->>LA: Store as table rows
  Tool->>LA: Query for charts, maps and alert rules
  LA-->>Tool: Results
        
FIG 2 — Sequence of one telemetry item
1

The application does its normal work

A request arrives, the code calls a database and a second service, and a response is returned. Nothing special happens from the user’s point of view.

2

Instrumentation observes and records

The library or agent notices the incoming request and each outgoing call, measures durations and captures errors, usually without the developer writing any code for these.

3

Context is attached

Each item receives the operation identifier, role name and other properties, so it can later be linked to related items.

4

Sampling and filtering are applied

To control volume, the layer may keep only a portion of the items, or drop noisy ones, before anything leaves the application.

5

Batches are sent

Telemetry is buffered and sent in groups to the ingestion endpoint over an encrypted connection, so the application is not slowed by many tiny network calls.

6

Data lands and becomes queryable

The workspace stores the items as rows. Charts, maps, alerts and your own queries then read from it, usually within a short delay of minutes rather than hours.

i
Practical Tip

If a chart looks empty right after a deployment, wait a few minutes before panicking. Use the live view for instant feedback, and the standard views for slightly delayed but deeper analysis.

6Instrumentation: Three Ways to Switch It On

The biggest change in recent years is how telemetry gets collected.

To produce telemetry, your application needs instrumentation. There are three broad ways to get it, and the right one depends on how much control you need and how much code you are willing to touch.

Auto-instrumentation (codeless)

An agent or extension attaches to your application without code changes. It is available on several Azure hosting services such as App Service, Functions and Kubernetes for selected languages. It is the fastest way to start and a good fit for quick wins, but offers less control over what is collected.

Azure Monitor OpenTelemetry Distro

A packaged distribution of the open-source OpenTelemetry project, preconfigured to send data to Application Insights. You add it to your application and gain automatic collection plus the ability to add your own spans, metrics and logs using open standards.

Classic Application Insights SDKs

The original, vendor-specific libraries that many older tutorials describe. Microsoft’s current guidance recommends starting with OpenTelemetry for new work, treats the classic API as superseded, and has published migration guidance, including explicit retirement dates for some language SDKs. Check the official pages for exact dates for your language.

ApproachCode changesControlGood for
Auto-instrumentationNone or minimalLowerQuick start, many existing apps, platform teams
OpenTelemetry DistroSmall setup changeHigh, with open standardsNew projects and long-term strategy
Classic SDKLibrary calls throughout codeHigh but vendor specificExisting applications awaiting migration

Why OpenTelemetry matters

OpenTelemetry is an industry-wide, open standard for producing and sending telemetry. If your code is instrumented with it, you are not locked into a single vendor. You can send the same data to Application Insights today and to another system tomorrow, or to both at once. Libraries and frameworks increasingly emit OpenTelemetry data on their own, which means richer telemetry with less work from your team.

Simple Analogy

The old approach is like a power plug that only fits one brand of appliance. OpenTelemetry is like a universal socket standard: whatever you plug in, from any maker, works with the wall.

!
Do Not Panic, But Do Plan

An application using a classic SDK does not stop working overnight, but investment has moved elsewhere. Inventory your applications, note which instrumentation each uses and schedule migrations for the ones that matter most.

i
Connection Strings, Not Keys

Pointing an application at a resource is done with a connection string. Older configurations that used only an instrumentation key should be updated, since Microsoft retired key-only ingestion in favour of connection strings.

7The Data Model and Where Data Lives

Every telemetry type becomes a table you can query.

Because Application Insights stores its data in a Log Analytics workspace, each telemetry type lands in a table with a recognisable name. Knowing the mapping helps you move from portal screens to custom investigations.

Telemetry typeTypical workspace tableAnswers the question
RequestsAppRequestsWhat did my application receive, how long did it take and did it succeed?
DependenciesAppDependenciesWhat did my application call and how did those calls behave?
ExceptionsAppExceptionsWhat went wrong and where?
TracesAppTracesWhat did the code say about what it was doing?
Custom eventsAppEventsWhich business actions happened?
MetricsAppMetricsWhat do my numbers look like over time?
Page viewsAppPageViewsWhat are browsers showing and how fast?
Availability resultsAppAvailabilityResultsIs the application reachable from outside?

The data model in one picture

Think of an operation as a tree. At the top sits the incoming request. Beneath it hang the dependency calls it made, each possibly a request into another service with its own children. Exceptions and traces attach to whichever node produced them. The operation identifier is shared by every node in the tree, and a parent identifier records which node called which. This structure is what makes end-to-end tracing possible.

i
Good to Know

Table and column names evolve as the platform standardises on OpenTelemetry concepts. When you write queries or build workbooks, confirm the current schema in the documentation rather than copying old examples blindly.

!
Retention

Retention is controlled at the workspace level and differs by table and plan. Decide how long you need detailed records for investigation, compliance or trend analysis, and set it deliberately rather than accepting the default by accident.

8Distributed Tracing and the Application Map

Follow one request through every service it touches.

The feature that surprises newcomers most is end-to-end tracing. When service A calls service B, which calls a database, the instrumentation passes a small piece of context along with each call. Because every hop shares the same operation identifier, Application Insights can reassemble the whole journey afterwards, even when the services are written in different languages and run on different platforms.

flowchart TD
  U["Browser"] --> W["web-frontend"]
  W --> O["orders-api"]
  W --> C["catalog-api"]
  O --> P["payments-api"]
  O --> D[("Orders database")]
  C --> R[("Cache")]
  P --> X["External payment provider"]
        
FIG 3 — An application map showing how services call each other

What the application map gives you

The application map draws exactly this picture automatically from your telemetry. Each box is a component identified by its cloud role name, and each arrow is a call between them. The boxes show call volume, average duration and failure rate, so a slow or failing dependency stands out visually, often coloured to draw your eye. It is the fastest way to answer “where is the problem?” before you ask “what is the problem?”.

The end-to-end transaction view

Clicking into a slow or failed request opens the end-to-end transaction view. It shows a timeline of every operation in that request across all services, with durations laid out like a waterfall. You can see at a glance that, for example, eight hundred of the nine hundred milliseconds were spent waiting for one database query, and you can open the related exceptions and traces right there.

Simple Analogy

Imagine tracing a parcel that passed through five depots. The application map is the route diagram showing all depots and how busy each is. The end-to-end transaction view is the detailed scan history of one specific parcel, showing exactly how long it waited at each stop.

!
Common Mistake

Leaving the cloud role name at its default or giving several services the same name. The map then merges unrelated components into one confusing box. Set a clear, unique role name for every service and, where useful, for every worker role inside it.

“A trace turns a mystery into a timeline.”

9Investigation Tools: From Symptom to Cause

Different questions call for different screens.

Application Insights offers a family of investigation tools. Rather than memorising them, it helps to match each to the question you are asking at that moment.

Right now

Live metrics

A near real-time stream of request rate, failures, response time and server health. Excellent while a deployment is rolling out or an incident is in progress.

What fails

Failures

Groups failed requests, exceptions and failing dependencies, showing which operations break most and what they have in common.

What is slow

Performance

Ranks operations and dependencies by duration and shows distributions, so you see not just averages but the slow tail that frustrates real users.

Find one item

Transaction search

Searches individual telemetry items by text, type, time or properties, useful when you have a specific user report to chase.

Inside the code

Profiler

Captures sampled traces showing which methods consumed time during slow requests, for supported platforms.

Inside the error

Snapshot debugger

Captures a snapshot of variable values at the moment of an exception on supported setups, so you can inspect the state that caused it.

Early warning

Smart detection

Learns normal behaviour and warns about unusual changes, such as a sudden jump in failure rate or a slow degradation in response time.

A calm investigation routine

1

Start wide with the map

Open the application map to see which component is red or slow. Do not dive into logs before you know where to look.

2

Narrow with failures or performance

Pick the affected operation and see the most common exception or the slowest dependency.

3

Open a representative sample

Choose one failed or slow request and read its end-to-end transaction.

4

Confirm with a query

Use a query to check whether the pattern holds across all affected requests, such as one version, one region or one customer.

i
Look at the Tail

Averages hide pain. A service with a fine average can still make one user in a hundred wait ten seconds. Look at high percentiles, not just the mean.

10Availability Monitoring: Watching From Outside

Your own telemetry cannot tell you the app is down if the app is too dead to speak.

Everything discussed so far is produced from inside your application. If the whole application crashes, or a network problem blocks users from reaching it, no telemetry is produced at all, and silence can look like peace. Availability tests solve this by acting like a user from outside: they call your application on a schedule from several locations around the world and record whether it answered correctly and how quickly.

Standard tests

The recommended single-step test. It checks a web address on a schedule, supports different request types and custom headers, and verifies things such as certificate validity and expected response content.

Custom tests with your own code

For multi-step journeys, such as signing in and then placing an order, you can run your own scheduled code and report results back as availability data.

URL ping tests

The older, simpler test type. Microsoft has announced its retirement and recommends moving to standard tests. The retirement date has been reported with changes over time, so check the official announcement for the current date, and plan the move well before it.

Designing a useful test

A test that only checks for a successful response code can be fooled by an error page served with a success code. Make tests verify something meaningful, such as the presence of expected content, and point them at a lightweight health address that exercises key dependencies without doing heavy work. Run them from several locations so a single regional network glitch does not wake your team at night.

Simple Analogy

Availability tests are like a mystery shopper who walks into your shop every few minutes from different cities. Even if the shop’s own cameras and tills have all failed, the shopper still reports that the door was locked.

!
Alerting Tip

Alert when several locations fail at once, not when one fails once. This cuts false alarms dramatically while still catching real outages quickly.

11Browser Monitoring and Usage Analytics

The server’s view is only half the story; the other half happens in the user’s browser.

A page can be served by your back end in fifty milliseconds and still feel slow because of heavy scripts, large images or a slow device. To see that half of the experience, you add the JavaScript monitoring library to your pages. It records page load timings, browser exceptions, calls made from the browser and, importantly, links them to the matching server requests so one trace can span browser and back end.

Usage analytics for product questions

Beyond health, the same data answers questions about behaviour. Teams use it to understand how many people use a feature, in what order they move through steps and where they drop out.

Usage

Users, sessions and events

Counts of distinct visitors, visits and custom actions over time, split by browser, country or version.

Flow

User flows

Shows the typical paths people take through your application and where they go next.

Conversion

Funnels

Measures how many people complete each step of a process such as checkout, revealing where they abandon it.

Loyalty

Retention and cohorts

Shows how many people return over time and compares groups who started in different periods.

!
Privacy Warning

Browser monitoring and usage tracking involve data about real people. Collect only what you need, avoid recording personal details in event names or properties, respect consent rules where they apply, and follow your organisation’s privacy requirements.

i
Business Events

Custom events for key business moments, such as “trial started” or “invoice paid”, let product and engineering teams look at the same dashboard and speak the same language.

12Querying, Workbooks and Dashboards

Ready-made screens answer common questions; queries answer yours.

Built-in screens cover many needs, but real investigations soon outgrow them. Because the data lives in Log Analytics, you can query it with the Kusto Query Language, usually shortened to KQL. It reads like a pipeline: you start with a table, then filter, group, summarise and sort step by step. Even a few basic operations, such as counting failures per operation over the last day or finding the slowest percentile per dependency, answer questions that no fixed screen anticipated.

Three ways to present what you find

Workbooks

Interactive, shareable reports that combine text, queries, charts and parameters. Teams use them for incident reviews, release health reports and usage summaries. They can be parameterised so one workbook serves many applications.

Azure dashboards

Pin charts from many services onto one board, suited to wall displays or quick daily checks.

Managed Grafana and other visualisation tools

Organisations that already use other dashboard tools can read Azure Monitor data from them, keeping one familiar place for all visuals.

i
Save Your Best Queries

When someone writes a query that solved an incident, save it in a shared place and name it clearly. A growing library of proven queries turns tribal knowledge into a team asset and shortens the next incident.

!
Authentication for Programmatic Access

Reading telemetry from scripts or tools used to rely on API keys. Microsoft has announced the retirement of API key access for querying data, with Entra ID authentication through managed identities or service principals as the replacement. Check your integrations and update any that still depend on keys.

13Alerts and Action Groups

Be told about trouble before your users tell you.

Collecting data is pointless if nobody looks at it in time. Alerts turn data into attention. An alert rule defines a condition to watch, such as failure rate above a threshold for five minutes. When the condition is met, the rule fires and triggers an action group, which is a reusable list of things to do: send an email or a mobile notification, call a webhook, start an automation or open a ticket in your incident tool.

flowchart LR
  T["Telemetry in workspace"] --> R["Alert rule evaluates condition"]
  R -->|"Condition met"| A["Alert fires"]
  A --> G["Action group"]
  G --> E["Email or mobile push"]
  G --> W["Webhook to incident tool"]
  G --> M["Automation runbook"]
  R -->|"Condition not met"| S["Keep watching"]
        
FIG 4 — From telemetry to notification

Kinds of alert rules

Fast

Metric alerts

Evaluate numbers frequently, ideal for response time, failure counts and resource pressure. Quick and cheap to run.

Flexible

Log search alerts

Run a query on a schedule and alert on its result, allowing complex conditions that metrics cannot express.

Outside-in

Availability alerts

Fire when availability tests fail from enough locations.

Adaptive

Smart detection and dynamic thresholds

Learn what normal looks like and warn about unusual deviations without hand-tuned limits.

What makes an alert good

A good alert is actionable, urgent and rare. If it fires and nobody needs to do anything, it teaches people to ignore alerts. Alert on symptoms users feel, such as high failure rates or slow responses, rather than on every internal cause, such as a single processor spike. Link each alert to a short runbook that says what it means and what to try first.

Simple Analogy

A good smoke alarm sounds when there is smoke, not whenever you make toast. If it screams every morning, you take out the battery, and then it is useless on the one day it matters. Alert fatigue works exactly the same way.

!
Common Mistake

Sending every alert to one shared mailbox. Route by severity and ownership: urgent customer-facing problems should reach the on-call person immediately, while informational notices can wait for working hours.

14Sampling, Cost and Pricing

Telemetry is billed by volume, so volume deserves design.

The main cost driver is the amount of data ingested into the workspace, measured in gigabytes. Pricing tiers, free allowances and commitment discounts exist and change over time, so check the current Azure Monitor pricing page for exact figures instead of relying on older articles. What does not change is the principle: more telemetry means more cost, and a few simple habits keep both reasonable.

flowchart TD
  A["Telemetry volume too high?"] --> B{"Which type dominates?"}
  B -->|"Dependencies and requests"| C["Apply sampling"]
  B -->|"Traces and logs"| D["Raise minimum log level and filter noise"]
  B -->|"Custom metrics"| E["Reduce dimensions and frequency"]
  A --> F["Set a daily cap as a safety net"]
  C --> G["Review in Log Analytics usage views"]
  D --> G
  E --> G
        
FIG 5 — A simple approach to controlling telemetry cost

Sampling explained

Sampling means keeping only a fraction of the telemetry, for example one item in five, while still letting charts show correct totals. Good sampling keeps related items together, so that if one request is kept, its dependency calls and exceptions are kept too. Some instrumentation adjusts the rate automatically as traffic changes, while other setups use a fixed rate. Sampling is the biggest single lever you have, and for high-traffic services it is nearly always worth using.

Advantages of sampling

  • Large reduction in ingestion cost
  • Less load on the application and network
  • Related items stay together for tracing
  • Totals in charts remain statistically accurate

Trade-offs

  • Some individual requests will not be recorded
  • Rare events may be missed at aggressive rates
  • Counting by raw rows can mislead unless adjusted

Other cost habits

Trim the noise

Debug-level logs in production, health-check requests every few seconds and chatty background loops can dominate the bill while adding little insight. Filter or lower them.

Mind custom metrics

Metrics with many distinct dimension values, such as one per user, create huge numbers of series. Keep dimensions low in cardinality.

Set a daily cap carefully

A daily limit stops runaway bills, but when it is reached, new telemetry is dropped until the next day, possibly during an incident. Treat it as a safety net and alert before you reach it.

Choose retention on purpose

Keep detailed data only as long as you need it, and archive or summarise the rest.

15Security, Privacy and Governance

Telemetry is data, and data needs protecting.

Telemetry often contains more than people expect: web addresses with identifiers in them, user names, internal server names, error messages with fragments of data and even request bodies if someone logged them carelessly. Treat the monitoring system with the same seriousness as the application itself.

Layer 1

Control who can send

Connection strings are not secrets in the same way as passwords, but anyone who has one can send data to your resource. Use Entra ID authentication for ingestion where supported, and consider turning off local, key-based authentication so only authenticated identities can send data.

Layer 2

Control who can read

Use role-based access control to grant least privilege. Developers may need read access to one application’s data, while only a few need access to configuration or to the entire workspace.

Layer 3

Network isolation

Private networking options can keep telemetry traffic off the public internet for sensitive workloads. Check current documentation for how to configure them.

Layer 4

Data minimisation

Do not log passwords, tokens, card numbers or health details. Scrub or filter sensitive fields before they leave the application.

Layer 5

Programmatic access

Use managed identities or service principals with Entra ID, not API keys, for reading data from tools and scripts.

Layer 6

Retention and residency

Choose workspace regions and retention periods that meet your legal and regulatory obligations.

Simple Analogy

Security for telemetry is like security for a company’s CCTV room. The cameras record everything, so you restrict who can enter the room, who can add new cameras, what the cameras are allowed to point at and how long the tapes are kept.

!
Accidental Data Leaks

The most common privacy incident is not an attack. It is a developer logging a full request or an exception message that contains personal data, which then sits in the workspace for months. Review what you log, and add automated checks where possible.

16Organising Resources and Workspaces at Scale

Decisions made on day one are hard to change after a hundred applications.

Small teams can put everything in one place and be happy. As the number of applications grows, the way you arrange resources and workspaces shapes cost visibility, access control and the quality of tracing across services.

Resources per application or shared?

One resource per environment per solution

  • Related services appear together on one application map
  • End-to-end tracing works without extra effort
  • Easy to understand and to hand over
  • Separate production and test data cleanly

One huge shared resource for everything

  • Maps become unreadable with unrelated services
  • Hard to attribute cost to teams
  • Access control becomes coarse
  • Noisy neighbours can drown out important data

Workspace strategy

Because data lives in a workspace, you choose how many to have. A common pattern is a small number of workspaces per environment and region. Fewer workspaces make cross-service queries easy and can lower cost through shared commitment tiers. More workspaces give stronger isolation for data ownership or regulation. Decide based on who needs to see what, and where data must be stored.

Habits for tidy operations

1

Name consistently

Agree on naming for resources, role names and environments, so maps and queries are readable by anyone.

2

Define everything as code

Create resources, alert rules and action groups with infrastructure-as-code so every environment matches and changes are reviewed.

3

Tag for ownership and cost

Apply tags for team, product and environment so bills and incidents reach the right people.

4

Review regularly

Look at ingestion by table and by application each month, remove unused resources and revisit alert rules.

17Design Patterns and Anti-patterns

Shapes that work, and shortcuts that hurt later.

Patterns worth adopting

Pattern 1

One trace across every hop

Ensure every service, queue consumer and browser passes context along, so one identifier ties the whole journey together.

Pattern 2

Symptom-based alerting

Alert on what users feel, such as failure rate and latency, and use dashboards for causes.

Pattern 3

Health endpoints plus outside tests

Expose a lightweight health address and test it from several regions with standard availability tests.

Pattern 4

Release markers and comparison

Record deployments as annotations so you can see instantly whether a change in behaviour started with a release.

Pattern 5

Business events next to technical events

Record key business actions so product and engineering share one source of truth.

Pattern 6

Standard OpenTelemetry instrumentation

Use open standards so your investment in instrumentation survives changes of tooling.

Anti-patterns to avoid

ANTI-PATTERN-01 Avoid
Problem

Every service shares one resource and keeps the default role name.

Why It’s Harmful

The application map merges everything into a single blob, tracing across services is hard to read and cost cannot be attributed to any team.

Correct Approach

Use clear, unique role names, group related services in one resource per environment, and tag resources with ownership.

ANTI-PATTERN-02 Avoid
Problem

Logging everything at the most detailed level in production.

Why It’s Harmful

Ingestion cost balloons, queries slow down and the useful signals drown in noise. Sensitive data is also more likely to be captured.

Correct Approach

Use warning level and above by default, raise detail temporarily during investigations and apply sampling for high-volume items.

ANTI-PATTERN-03 Avoid
Problem

Alerting on every internal metric and sending all alerts to a shared mailbox.

Why It’s Harmful

People learn to ignore the flood, and real incidents are missed or noticed late.

Correct Approach

Alert on user-facing symptoms, route by severity to the right owners and attach a runbook to each alert.

ANTI-PATTERN-04 Avoid
Problem

Starting new applications on a vendor-specific classic SDK and never planning a migration.

Why It’s Harmful

Investment and new features are moving to OpenTelemetry, so the application accumulates technical debt and may eventually face retirement deadlines.

Correct Approach

Begin new work with OpenTelemetry-based instrumentation and schedule migration of existing applications by business importance.

18Best Practices and Common Mistakes

Habits that separate calm operations from constant firefighting.

Best practices

  • Instrument early. Switch on monitoring in development and test, not only after the first production incident.
  • Name your components. Unique, meaningful role names make maps and queries readable by anyone on the team.
  • Trace across boundaries. Check that queues, background jobs and browser calls carry trace context.
  • Watch outside-in. Pair internal telemetry with availability tests from several locations.
  • Alert on symptoms. Choose a few high-value alerts and tune them until they are trusted.
  • Control volume. Use sampling, filter noise and review ingestion by table every month.
  • Protect the data. Use role-based access, Entra ID authentication and strict rules on what may be logged.
  • Record releases. Mark deployments on charts to link changes in behaviour to changes in code.
  • Automate setup. Keep resources, alerts and dashboards in code so environments stay consistent.
  • Practise using it. Run game days where the team finds a planted fault using only the monitoring tools.

Common mistakes

!
Mistake 1

Judging health by averages. Averages hide the slow tail, so a service can look fine while a sizeable group of users suffers. Look at percentiles.

!
Mistake 2

Counting rows when sampling is on. If only a fraction of items is stored, a raw row count under-reports reality. Use the aggregated charts or adjust counts using the recorded sampling information.

!
Mistake 3

Treating a missing chart as a healthy system. Silence can mean the application stopped sending data. Alert on an unexpected drop in telemetry as well as on errors.

!
Mistake 4

Hitting the daily cap in the middle of an incident. When the cap is reached, new data is dropped, so the very data you need is missing. Alert well before the cap and size it generously.

!
Mistake 5

Relying on outdated configuration. Old setups using key-only ingestion, API key reads or classic resources may stop working as features are retired. Review your estate against current announcements.

i
Troubleshooting Order

When data is missing, check in this order: Is the connection string correct and pointing at the intended resource? Is the application able to reach the ingestion endpoint? Is sampling or filtering dropping the items? Is a daily cap reached? Has authentication been enforced without the application being given an identity? Then wait a few minutes for ingestion delay before concluding that nothing arrived.

19Real-world and Industry Examples

How different teams put the flight recorder to work.

The following scenarios are typical patterns rather than descriptions of specific companies. They show how the same capabilities combine for very different needs.

Online retailer during a sale

Traffic jumps tenfold during a promotion. Live metrics show the failure rate creeping up, the application map highlights the payment service as slow, and the end-to-end transaction view reveals that a single external provider call is timing out. The team switches to a fallback provider within minutes, long before customers flood the support line.

Bank with strict compliance rules

A bank keeps telemetry in region-specific workspaces, uses private networking, scrubs personal data before it leaves the application and applies tightly scoped read access. Retention is set to satisfy audit requirements, and alerts feed directly into the incident management process.

Software-as-a-service provider tracking features

The product team uses custom events and funnels to see how many new customers finish onboarding. A drop at one step leads to a redesign. Engineers use the same data to spot that the step also had slow back-end calls, fixing both the experience and the performance.

Microservices platform team

A central platform team provides a standard OpenTelemetry setup, naming rules and alert templates. Product teams inherit working tracing, consistent role names and sensible default alerts, so every new service appears correctly on the map from day one.

Internal line-of-business app

A small team running an employee portal uses auto-instrumentation on their hosting service, two availability tests and a handful of alerts. They get most of the value with almost no code change.

Release safety at a media company

Every deployment adds a release marker and a workbook compares error rate and latency before and after. When a release raises failures, the team rolls back in minutes, guided by evidence rather than guesswork.

“Good monitoring does not prevent every failure; it shortens the distance between failure and fix.”

20Frequently Asked Questions

Quick answers to questions that come up again and again.

Q1Is Application Insights a separate service from Azure Monitor?

No. It is the application monitoring capability within Azure Monitor. Its data is stored in a Log Analytics workspace, so it sits alongside other Azure Monitor data.

Q2Does it only work for applications running in Azure?

No. Applications on premises or in other clouds can send telemetry too, as long as they can reach the ingestion endpoint and are configured with a connection string.

Q3Should I use the classic SDK or OpenTelemetry for a new project?

Microsoft’s current guidance is to start with OpenTelemetry using the Azure Monitor distribution. The classic API is treated as superseded and has published migration guidance, so new projects should avoid building on it.

Q4What is the difference between logs and metrics here?

Logs store individual records that you can search and explain. Metrics store pre-aggregated numbers over time that are fast to chart and ideal for alerting on trends.

Q5How does it know which services belong to one request?

Instrumentation passes trace context along each call, and every item carries the same operation identifier. The tools then reassemble the whole journey from those shared identifiers.

Q6Why is my data missing in the portal?

Typical causes are a wrong connection string, blocked network access to the ingestion endpoint, aggressive sampling or filtering, a reached daily cap, or authentication enforced without an identity for the application. Also allow a few minutes of ingestion delay.

Q7How can I reduce the cost?

Apply sampling, filter noisy items such as frequent health checks, raise the minimum log level in production, keep metric dimensions low in cardinality and set retention intentionally. Review ingestion by table every month.

Q8What should I use to check that my site is up?

Use standard availability tests from several locations, ideally against a lightweight health address. The older URL ping test type has an announced retirement, so move to standard tests and check the official page for the latest date.

Q9Can I monitor the browser as well as the server?

Yes. Adding the JavaScript monitoring library records page loads, browser errors and calls made from the page, and links them to the matching server requests.

Q10Is it safe to put personal data in telemetry?

It is best not to. Collect the minimum, scrub sensitive fields before they leave the application, restrict access with roles and set retention that fits your legal duties.

Q11How should scripts read data from Application Insights?

Use Entra ID authentication with a managed identity or service principal. Access through API keys has an announced retirement, so update any tools that still depend on keys.

21Summary and Key Takeaways

Application Insights is the flight recorder for your software. Instrumentation inside your application produces requests, dependencies, exceptions, traces and metrics, a connection string sends them to Azure Monitor, and a Log Analytics workspace stores them so maps, traces, queries, workbooks and alerts can turn raw data into understanding. The recommended way to feed it has shifted to OpenTelemetry, with auto-instrumentation for quick starts and the classic SDKs in the process of being superseded. Success depends less on switching it on and more on a few design choices: naming components well, tracing across every boundary, alerting on symptoms users feel, controlling volume and protecting the data you collect.

Key Takeaways

  • It is a feature of Azure Monitor — data is stored in a Log Analytics workspace, which controls retention, access and much of the billing.
  • Learn the telemetry types — requests, dependencies, exceptions, traces, metrics, events, page views and availability results each answer a different question.
  • Start with OpenTelemetry — use the Azure Monitor distribution or auto-instrumentation for new work, and plan migration for older classic SDK applications.
  • Tracing needs good names and shared context — unique role names and trace context across every hop turn the application map into a trustworthy picture.
  • Watch from the outside too — standard availability tests from several locations catch outages that internal telemetry cannot report.
  • Alert on symptoms, not noise — route by severity, attach runbooks and avoid alert fatigue that hides real incidents.
  • Design for cost and privacy — use sampling, filter noise, set retention deliberately, use Entra ID authentication and never log sensitive personal data.