Azure Application Insights: Seeing Inside Your Applications in Production

Azure Application Insights: Seeing Inside Your Applications in Production

A complete, plain-English guide to Application Insights: telemetry, instrumentation, distributed tracing, the application map, failures and performance, availability tests, usage analytics, alerts, sampling, security, cost, and the habits that turn raw signals into fast, calm incident response.

Imagine you own a busy restaurant, but the kitchen has no windows and the dining room has no waiters who talk to you. You only learn about problems when customers storm out, or when the bank statement arrives. Now imagine instead that the kitchen has a live display showing every order, how long each dish takes, which cooks are overloaded, which suppliers deliver late, and a bell that rings the moment a table waits too long. You would fix problems before customers ever complained. Application Insights is that display, that bell and that logbook for your software.

This guide assumes you know nothing about application monitoring. Each new term is explained when it first appears, with an everyday comparison. We then go deep: what data is collected and how, how a single user request is followed across many services, how to find the cause of a failure or a slowdown, how alerts are built, how to control the volume and cost of data, and how to keep the data secure. Azure’s monitoring products have been evolving quickly, with older features retired and newer standards adopted, so where details may have moved, we say so and recommend checking the current official documentation.

1Why Monitoring Matters and What Application Insights Is

You cannot fix what you cannot see, and in production you cannot see anything without help.

The problem of invisible software

When software runs on a developer’s laptop, you can watch it, pause it and poke at it. When it runs in the cloud for thousands of users, it becomes invisible. It runs on servers you never touch, across several services, under traffic you cannot predict. Errors happen for some users and not others. A page loads fast in the morning and slowly at night. A new release quietly breaks one rarely used feature. Without monitoring, you learn about all of this from angry emails.

Application performance monitoring, usually shortened to APM, is the practice of collecting information about how an application behaves while it runs, so that teams can detect problems early, find their causes quickly, and understand how people use the product. Application Insights is Azure’s APM service. It is a feature of Azure Monitor, Microsoft’s broader platform for collecting and analyzing data about cloud and on-premises systems.

Simple Analogy

A car has a dashboard with speed, fuel and warning lights, and a diagnostic port that a mechanic can plug into. Application Insights gives your application a dashboard for everyday driving and a diagnostic port for when something goes wrong.

What it can tell you

Question 1

Is it working?

Success and failure rates of requests, exceptions thrown, and whether the application responds to checks from around the world.

Question 2

Is it fast?

Response times for each page or operation, and which step, such as a database call, is responsible for slow responses.

Question 3

What is broken and why?

Stack traces, failing dependencies, the exact sequence of calls for one failed user request across many services.

Question 4

How do people use it?

Which features are popular, where users drop out of a process, and how many return after the first visit.

4
questions: working, fast, broken, used
1
place to see logs, metrics and traces together
Minutes
typical time from event to visibility
i
Good to know

Monitoring is not the same as fixing. It shortens the time between “something is wrong” and “we know exactly where”. That time, often called time to detect and time to resolve, is what separates a minor blip from a front-page outage.

2Where Application Insights Sits: Azure Monitor and Log Analytics

Understanding the family tree prevents a lot of confusion about names and billing.

Azure Monitor is the umbrella. It collects metrics, which are numbers measured over time, and logs, which are detailed records of events, from Azure resources, applications, virtual machines and containers. Log Analytics is the storage and query engine for logs inside Azure Monitor. A Log Analytics workspace is a container in your subscription where log data is kept and queried. Application Insights is the application-focused part of Azure Monitor, with a special set of features and tables for application telemetry.

flowchart TD
  AM["Azure Monitor"] --> M["Metrics"]
  AM --> L["Logs in Log Analytics workspace"]
  AM --> AI["Application Insights features"]
  AI --> T["Application telemetry tables in the workspace"]
  L --> T
  AM --> AL["Alerts and action groups"]
  AM --> W["Workbooks and dashboards"]
        
FIG 1 — Application Insights is the application-focused part of Azure Monitor, backed by a Log Analytics workspace

Workspace-based Application Insights

Earlier versions of Application Insights kept their data in a separate private store. Today, a resource is created as workspace-based, meaning its telemetry is stored in a Log Analytics workspace that you choose. This has important consequences. You can query application data together with infrastructure and platform logs in one place. You can apply workspace-level security, retention, data export and cost controls. And billing follows the workspace pricing model. The older classic form has been retired and migrated, so any new resource should be workspace-based.

!
Check Before You Plan

Azure Monitor has been changing in several ways: classic resources were retired in favor of workspace-based ones, the standard for collecting telemetry has been moving toward open industry formats, older ways of identifying a resource have been phased out in favor of connection strings, and several older test types and export features have been retired. Confirm current status and retirement dates in the official documentation before designing a new setup or relying on a feature mentioned in an old article.

Simple Analogy

Azure Monitor is the whole security control room of a building. Log Analytics is the archive room where all recordings are stored and searched. Application Insights is the specialized desk in that room that watches the shop floor, with its own screens built just for watching applications.

3The Kinds of Telemetry

Telemetry is data sent automatically from a running application to a monitoring service.

Telemetry typeWhat it recordsExample question it answers
RequestsIncoming calls to your application: URL, duration, result code, successWhich operations are slowest or failing most?
DependenciesOutgoing calls your application makes to databases, other services and web interfacesIs the slowness caused by the database or a partner service?
ExceptionsErrors thrown by the code, with stack tracesWhat error is happening and in which method?
TracesLog messages written by developers, with severityWhat did the code say just before it failed?
Page views and browser dataPages loaded in a browser, load times, client-side errorsHow fast does the page feel to a real user?
Custom eventsBusiness actions you define, such as “order placed”How many people completed checkout?
MetricsNumbers over time, such as queue length or processor useIs memory growing steadily?
Availability resultsOutcomes of synthetic tests that call your application from outsideIs the site reachable from other regions?
Simple Analogy

For a delivery company, requests are orders received, dependencies are calls to suppliers and carriers, exceptions are damaged parcels, traces are the clerks’ notes, page views are customers browsing the catalog, and events are completed sales. All six are needed to understand the business.

The three pillars of observability

Modern monitoring talks about three pillars: logs, which are detailed event records; metrics, which are aggregated numbers over time; and traces, which follow a single request through many components. Application Insights stores all three in the same place and lets you jump between them. You may notice a spike in a metric, drill into the traces of slow requests, and read the logs around one failing step.

i
Practical Rule

Use metrics to notice, traces to locate and logs to explain. Metrics are cheap and fast for alerting, traces show where time went, and logs carry the detailed words that tell you why.

4How Data Flows from Your Application to the Portal

A short journey with several places where data can be lost or delayed.

sequenceDiagram
  participant APP as Application with instrumentation
  participant BUF as Local buffer
  participant ING as Ingestion endpoint
  participant WS as Log Analytics workspace
  participant PORT as Portal, alerts and queries
  APP->>BUF: Create telemetry items
  BUF->>ING: Send batches over HTTPS
  ING->>WS: Validate and store
  WS->>PORT: Available for queries and alerts
  Note over APP,PORT: Typical delay is seconds to a few minutes
        
FIG 2 — The path of telemetry from the application to the portal
1

Instrumentation creates telemetry

A small piece of code, called instrumentation, watches your application. It records each incoming request, each outgoing call and each exception automatically, and lets you add your own events and metrics.

2

Local processing

Before sending, the data may be sampled, filtered or enriched with extra properties such as the application’s name and version.

3

Batched sending

Items are collected in memory and sent in small batches to an ingestion endpoint, using a connection string that identifies the destination resource.

4

Ingestion and storage

The service checks the data, applies limits such as daily caps, and stores it in the workspace.

5

Analysis and alerting

The data becomes available for portal views, queries, workbooks and alert rules, usually within minutes.

Simple Analogy

It is like a reporter filing news from the field. The reporter notes events, edits them briefly, sends them in batches to the newsroom, the editors file them in the archive, and readers can then search and be alerted about important stories.

!
Common Mistake

Expecting data to appear instantly and concluding that monitoring is broken. Telemetry normally appears within a short delay, and some views take a few minutes longer. Wait several minutes before troubleshooting an apparently missing item.

5Instrumentation Options: Codeless, SDK and OpenTelemetry

There is more than one way to switch monitoring on, and the choice affects control, effort and future flexibility.

Option 1

Auto-instrumentation, also called codeless

Monitoring is enabled by a setting on the hosting platform, such as an app service, function app, virtual machine or container platform. No code changes. Fast and easy, with fewer custom options.

Option 2

Azure Monitor OpenTelemetry distribution

A package you add to your app that uses the open OpenTelemetry standard and sends data to Azure Monitor. Available for several popular languages. This is the direction Microsoft recommends for new work.

Option 3

Classic Application Insights SDKs

The older language-specific libraries. Many applications still use them, but newer investment is going into the OpenTelemetry approach, so check the current support status.

Option 4

Browser JavaScript SDK

A script added to web pages to collect page loads, browser errors and user actions from real visitors’ browsers.

Option 5

Agents for specific runtimes

For example, a Java agent that attaches to the application at start-up with no code changes while allowing configuration.

What OpenTelemetry means for you

OpenTelemetry is an open industry standard, supported by many vendors, for generating and exporting telemetry. Using it means your instrumentation is not locked to a single vendor. You can send the same data to Azure Monitor today and to additional destinations later if needed. Because it is a community standard, it also benefits from many ready-made integrations with popular libraries and frameworks.

ApproachEffortControlBest for
Auto-instrumentationVery lowLimitedQuick start, legacy applications where code cannot change
OpenTelemetry distributionLow to moderateHighNew applications and long-term strategy
Classic SDKModerateHigh, with familiar APIsExisting applications already using it, until migration
Browser SDKLowModerateWeb front ends that need real user monitoring

The connection string

Every Application Insights resource has a connection string: a small piece of text that tells instrumentation where to send data. It includes the ingestion address and an identifier for the resource. Older setups used a bare instrumentation key, which has been phased out for ingestion in favor of connection strings, so use the connection string in all new configuration. Store it in application settings rather than in code, and use a separate resource, or at least a separate role name, for each environment.

Simple Analogy

The connection string is the delivery address on the parcel. If it is wrong or missing, the best instrumentation in the world sends its data nowhere.

i
Practical Rule

Start with auto-instrumentation to get value in minutes, then adopt the library-based approach when you need custom events, filtering, finer control or consistency across services.

6Distributed Tracing and Correlation

One click by a user may touch ten services. Tracing stitches them into one story.

Modern applications are rarely a single program. A request to place an order might pass through a web front end, an orders service, an inventory service, a payment service and a database. When something is slow, which one is guilty? Distributed tracing answers this by giving each request a unique identifier that travels with it through every service. Each service records its own piece of the work, called a span, tagged with the shared identifier, so that the whole journey can be reassembled later.

flowchart LR
  U["User request"] --> W["Web front end"]
  W --> O["Orders service"]
  O --> I["Inventory service"]
  O --> P["Payment service"]
  O --> D["Orders database"]
  P --> X["External payment provider"]
        
FIG 3 — One user request fanning out across several services
Concept

Operation ID

The shared identifier for the whole end-to-end transaction. Filtering by it shows every record related to one user action.

Concept

Parent and child

Each step records which step called it, so that the tool can draw the call hierarchy and show how time was spent.

Concept

Trace context headers

A standard way to pass the identifier between services in web calls, so that different technologies and languages can still join the same trace.

Concept

Cloud role name and instance

Labels that say which logical component and which running copy produced a piece of telemetry. They drive the application map and make filtering by service easy.

Simple Analogy

Distributed tracing is like attaching a tracking number to a parcel. Each depot scans it, so that later you can see exactly where it spent two days stuck, instead of only knowing that it arrived late.

!
Common Mistake

Leaving all services with the same default role name. The application map then shows one confusing blob, and filtering by service is impossible. Give each service a clear, unique role name and, where relevant, mark different environments clearly.

Correlation across messaging and background work

Not every call is a direct web call. Messages through queues, scheduled jobs and event streams break the simple chain. To keep correlation, the sender must attach the trace context to the message and the receiver must read it. Many libraries do this automatically for common services; for custom setups you must check that context is propagated, otherwise the trace appears to end at the queue.

i
Good to know

Include the operation identifier in your application’s error pages or support messages. When a user reports “something went wrong”, support can paste the identifier into the portal and see the whole story at once.

7Application Map and End-to-End Transaction Diagnostics

Two views that turn a pile of records into a picture.

Application map

The application map draws your system automatically as boxes and arrows. Each box is a component, such as a service or a database, and each arrow is a call between them. It shows call counts, average durations and failure rates on each connection, and colors problem areas. When an alert fires, the map is often the fastest way to see which component is the source and which are merely suffering from it.

flowchart LR
  A["Web app: healthy"] --> B["Orders API: slow"]
  B --> C["Inventory API: healthy"]
  B --> D["SQL database: high duration"]
  B --> E["Payment API: failing calls"]
  E --> F["External provider: timeouts"]
        
FIG 4 — An example application map where problems cluster around the payment path

End-to-end transaction diagnostics

When you pick one specific request, this view shows a timeline of everything that happened for it, across services: the incoming call, each dependency call with its duration, any exceptions and related log messages. You can see at a glance that, for example, four seconds of a five-second request were spent waiting for one external call.

1

Start from the map

Find the red or slow component and open its failures or performance view.

2

Pick a sample request

Choose a representative slow or failed request, often the slowest or the most recent.

3

Open the transaction timeline

Read where time went and where the error occurred, including calls to other services.

4

Read exceptions and traces

Look at the stack trace and nearby log messages to understand the cause.

5

Check how many are affected

Go back to the failure or performance view and see whether this is one user or a pattern.

Simple Analogy

The application map is the city traffic map showing red roads. Transaction diagnostics is the GPS trace of one specific car, showing exactly where it got stuck and for how long.

i
Practical Rule

Always confirm that a sample is representative. A single odd request can mislead. Check the distribution of durations and the count of affected users before deciding what to fix.

8Investigating Failures and Performance

The two most common reasons you open Application Insights.

The failures view

This view groups failed requests, failed dependency calls and exceptions, and ranks them by how many occurred and how many users were affected. You can see which result codes dominate, which operations fail most, and which exception types are most frequent. Selecting an item takes you to sample records and to the transaction timeline.

The performance view

This view shows the duration of each operation, often at several percentiles. A percentile describes the experience of the slowest portion of requests. For example, the ninety-fifth percentile is the duration under which ninety-five percent of requests complete, so the remaining five percent are slower. Averages hide pain: a service with a pleasant average can still leave a noticeable group of users waiting several seconds. Looking at high percentiles reveals this.

Measure

Average

The mean duration. Easy to read but easily distorted by a few very slow requests, and hides how bad the worst experiences are.

Measure

Median

The middle value: half of requests are faster, half slower. A good picture of the typical experience.

Measure

95th and 99th percentile

Show how slow the slowest few percent are. These are the numbers most closely tied to user frustration and to service level goals.

Measure

Failure rate

The share of requests that fail. Watch it per operation, since a rarely used operation failing completely can hide inside a healthy overall rate.

Simple Analogy

If a restaurant says its average wait is ten minutes, but one customer in twenty waits an hour, the average sounds fine while a steady stream of customers leave furious. Percentiles reveal those hour-long waits.

Common root causes

Pattern in the dataLikely causeNext step
Most of the request time is in one dependencySlow database query, overloaded service or network issueLook at the dependency’s own metrics and slow query data
Failures start right after a releaseCode or configuration changeCompare release time with failure start, check release annotations, consider rollback
Slowness only at certain hoursLoad, batch jobs or shared resource contentionCorrelate with traffic and infrastructure metrics
Failures in one region or instance onlyLocal infrastructure fault or a bad instanceFilter by instance and location, and restart or replace it
Rising memory or thread usage over daysResource leakUse performance counters and profiling to find the leak
Browser slow but server fastHeavy page assets or slow client networksLook at browser timing data and page weight
!
Common Mistake

Fixing the loudest exception instead of the most harmful one. A noisy but harmless error can dominate counts while a quiet one silently blocks purchases. Rank by user impact and business importance, not just by count.

9Live Metrics: Watching in Real Time

Sometimes seconds matter, and a few minutes of delay is too long.

Live Metrics shows what your application is doing right now with a delay of about a second. It displays request rates, failure rates, response times, dependency calls, exceptions, and server health such as processor and memory use, across all the instances. You can also see a live stream of sample requests and traces. This is not the place for historical analysis; it is the place to watch a deployment roll out, a load test run or an incident unfold.

Use

Release verification

Watch the numbers as a new version goes live, and spot a jump in failures within seconds.

Use

Incident response

Confirm whether a fix is working immediately instead of waiting for delayed charts.

Use

Load testing

Observe how the application behaves as test traffic ramps up, across all instances.

Simple Analogy

Live Metrics is the heart-rate monitor beside a hospital bed. The long-term charts are the patient’s medical file. During an emergency you watch the monitor; later you study the file.

i
Good to know

Live Metrics data is for viewing and is not stored in the same way as regular telemetry. Secure it like any other diagnostic feature, because it can expose live request details. Use identity-based access where supported and restrict who can open it.

10Availability Tests: Checking from the Outside

Internal telemetry cannot report that your application is completely unreachable, because a dead application sends nothing.

If your application crashes entirely, or its web address stops resolving, it cannot tell you. Availability tests solve this by acting like a user from outside: at regular intervals, from several locations around the world, they call your application and record whether it responded correctly and how fast. If several locations fail, an alert is triggered.

Type

Standard test

Makes a web request to a chosen address and checks status code, content and certificate details. The recommended basic test.

Type

Custom availability test

Your own code runs a scripted check, such as a multi-step login and purchase, and reports the result to Application Insights.

Legacy

URL ping and older multi-step tests

Older test types that have been or are being retired in favor of newer approaches. Check the current retirement status before relying on them.

flowchart LR
  T1["Test location: Europe"] --> A["Your application"]
  T2["Test location: Asia"] --> A
  T3["Test location: Americas"] --> A
  A --> R["Results stored in Application Insights"]
  R --> AL["Alert if multiple locations fail"]
        
FIG 5 — Availability tests probing the application from several regions
Simple Analogy

Availability tests are like mystery shoppers who regularly walk into your shop from different neighborhoods and report whether the doors were open and the staff responded. You do not rely only on your own staff saying everything is fine.

Design guidance

Test the important journeys, not just the home page. A home page may load while login, search or checkout is broken. Use a dedicated, lightweight health endpoint that checks critical dependencies, but do not make it so heavy that frequent testing overloads the system. Alert when several locations fail at once to avoid false alarms from a single regional network issue. Make sure the test runs against the same address the real users use, including any gateway or content delivery layer.

!
Common Mistake

Testing only a static home page served from a cache. The test stays green while the real application behind it is down. Test an endpoint that actually exercises the application and its key dependencies.

11Usage Analytics: Understanding People, Not Just Servers

Monitoring tells you the app works; usage analytics tells you whether anyone cares.

With browser and custom event telemetry, Application Insights can reveal how people use the product. These views help product teams make decisions with evidence rather than opinions.

View

Users, sessions and events

Counts of distinct users, visits and actions over time, with breakdowns by country, browser or version.

View

Funnels

Show how many people complete each step of a process, such as view product, add to basket, pay, and where they drop out.

View

User flows

Show the paths people take before and after a given page or action.

View

Retention

Show how many users return after their first visit, a sign of lasting value.

View

Cohorts

Groups of users sharing a trait or behavior, so you can compare how different groups use the product.

Simple Analogy

Server monitoring tells you the shop’s lights and tills work. Usage analytics is watching which aisles customers walk down, where they put things back, and how many come back next week.

Custom events with care

Define a small, meaningful set of events named after business actions, such as “checkout completed”, and attach useful properties such as plan type or feature name. Avoid sending personal information in event names or properties. Document your event catalog so that different teams use consistent names; inconsistent naming makes funnels and comparisons unreliable.

!
Common Mistake

Collecting browser telemetry without considering consent rules. Depending on your region and policies, tracking users may require consent and disclosure. Coordinate with privacy and legal teams before enabling user-level tracking.

12Logs and the Kusto Query Language

When the built-in views are not enough, you can ask your own questions.

All telemetry in the workspace can be queried with the Kusto Query Language, usually called KQL. It reads like a pipeline: start with a table, then filter, group, count, sort and chart step by step. Because everything is in one workspace, one query can combine application data with data from virtual machines, databases and platform services, which makes cross-cutting investigations possible.

TableWhat it holds
AppRequestsIncoming requests handled by your application
AppDependenciesOutgoing calls to databases, services and external interfaces
AppExceptionsExceptions with type, message and stack information
AppTracesLog messages with severity levels
AppPageViewsBrowser page loads and their timings
AppEventsCustom business events
AppMetricsCustom and standard metric data points
AppAvailabilityResultsResults of availability tests
AppPerformanceCountersServer resource counters such as processor and memory
!
Check Before You Plan

Table names differ between older and newer storage forms of Application Insights. Workspace-based resources use the names shown here, while older documentation and the legacy views use different names. Make sure the guide or sample you follow matches your resource type.

Questions that KQL answers well

Which operations got slower after the last release?

Compare the duration percentiles of each operation before and after the release time, and rank by the change.

Which users were hit by a specific exception?

Filter exceptions by type, then join to requests through the operation identifier to list affected operations and users.

What fraction of calls to a partner fail by hour?

Group dependency calls by target and hour, calculate the failure ratio, and chart it to spot patterns.

How does application slowness line up with database load?

Combine request durations with database platform metrics in the same workspace and chart them together.

Simple Analogy

The built-in views are the standard reports a bank gives every customer. KQL is being allowed to ask the bank’s analyst a custom question, such as “which accounts had unusual activity between two and four in the morning”, and getting a precise answer.

i
Practical Rule

Save useful queries and share them. A team library of tested investigation queries is one of the best investments for faster incident response, and new engineers learn the system through them.

13Metrics: Standard, Log-Based and Custom

Metrics are numbers over time, cheap to store and fast to alert on.

Kind

Standard metrics

Pre-aggregated numbers such as request rate, failed requests and server response time, calculated before sampling so they stay accurate even when you sample the detailed data.

Kind

Log-based metrics

Numbers computed on demand from the stored detailed records. Flexible, but affected by sampling and slower for large ranges.

Kind

Custom metrics

Numbers you define, such as items in a queue or orders per minute, which let you monitor business and technical values unique to your application.

Kind

Performance counters

Machine and runtime resource numbers such as processor use, memory, and request queue length.

Simple Analogy

Pre-aggregated metrics are the running totals the cashier tallies throughout the day. Log-based metrics are recalculated at closing time by reading every receipt. The running totals are always instantly available and correct, while the receipt method is flexible but slower.

Custom metrics: use with discipline

Custom metrics are powerful, but each unique combination of metric name and dimension values can create a separate series, and a high number of series raises cost and slows queries. Use dimensions with a small, bounded set of values, such as region or tier, and never use identifiers that are different for every user or request as a dimension.

ANTI-PATTERN-01 Avoid
Problem

A custom metric uses the customer identifier or request identifier as a dimension.

Why It’s Harmful

It creates millions of distinct series, which inflates cost, slows charts, may hit service limits and is useless for trend analysis.

Correct Approach

Use low-cardinality dimensions such as region or plan, and store per-customer detail as events or logs instead.

14Alerts, Action Groups and Smart Detection

Dashboards help when someone is looking. Alerts help when nobody is.

Types of alerts

Alert

Metric alerts

Trigger when a metric crosses a threshold, such as failure rate above a limit for several minutes. Fast and cost-efficient.

Alert

Log search alerts

Run a query on a schedule and trigger when results meet a condition. Very flexible for complex logic, with a little more delay.

Alert

Availability alerts

Trigger when availability tests fail from several locations.

Alert

Smart detection

Machine learning that learns normal behavior and warns about unusual changes such as a sudden rise in failures or a slow degradation, without you setting thresholds.

flowchart LR
  A["Telemetry"] --> B["Alert rule evaluates condition"]
  B -->|Condition met| C["Action group"]
  C --> D["Email or mobile push"]
  C --> E["Chat message to team channel"]
  C --> F["Incident tool or ticket"]
  C --> G["Automation such as scale out or restart"]
        
FIG 6 — An alert rule triggering an action group with several notification and automation paths

Designing alerts that people trust

1

Alert on symptoms users feel

Failure rate, high latency percentiles and availability are better signals than raw server counters, which may be high without harming anyone.

2

Use sensible windows and thresholds

Require the condition to hold for several minutes to avoid reacting to a single spike, and base thresholds on observed normal behavior.

3

Give every alert an owner and a runbook

Each alert should say who responds and link to steps for checking and fixing, so a tired person at night is not improvising.

4

Route by severity

Wake people only for urgent customer-impacting issues. Send lower-severity items to a channel or ticket queue for working hours.

5

Review and prune

Regularly review which alerts fired, which were useful and which were noise, and tune or delete accordingly.

Simple Analogy

A smoke alarm that rings every time you make toast gets its battery removed. An alert that fires too often is ignored, and then the one real fire goes unnoticed. Trust is the most valuable property of an alert.

ANTI-PATTERN-02 Avoid
Problem

Dozens of low-value alerts email a large group, with no owner and no severity levels.

Why It’s Harmful

People create mail filters to hide them, and genuine incidents are missed because they look identical to the noise.

Correct Approach

Fewer, better alerts with clear owners, severity-based routing and runbooks, reviewed regularly.

15Workbooks and Dashboards

Turn queries into shared, living reports.

A workbook is an interactive report built from text, queries, charts, tables and parameters. It is more flexible than a simple dashboard: you can offer drop-down selectors for environment or time range, link visuals so that clicking one filters another, and tell a story with headings and explanations. Azure dashboards, in contrast, are collections of tiles for a quick overview, suitable for wall displays or a daily glance. Many organizations also bring Application Insights data into external visualization tools used by operations teams.

Report

Health overview

Request rate, failure rate, latency percentiles and availability for each service, across environments.

Report

Release comparison

Side-by-side performance and failure metrics before and after a release, by version.

Report

Dependency health

Success and duration of every external call, by target, to hold partners and platforms accountable.

Report

Business and usage view

Funnels, active users and key custom events for product and leadership audiences.

Simple Analogy

A dashboard is a car’s dashboard: a few fixed gauges at a glance. A workbook is the full service manual with interactive diagrams where you can zoom in on any system, choose a model and follow a diagnostic path.

i
Practical Rule

Design each workbook for one audience and one purpose. A single giant report for everyone helps nobody. Keep one for on-call engineers, one for product managers and one for leadership.

16Profiler and Snapshot Debugger: Looking Inside the Code

Sometimes you know a request is slow or failing but not which line of code is responsible.

Tool

Profiler

Collects samples of what the code was doing during real requests in production, then shows a breakdown of where time was spent, down to specific methods. It runs with low overhead.

Tool

Snapshot Debugger

When an exception occurs, captures a snapshot of the application’s state, such as variable values and the call stack, so a developer can inspect it later as if they had paused the program at that moment.

Simple Analogy

Profiler is a stopwatch hidden in each room of a factory telling you which station is slow. Snapshot Debugger is a camera that takes a photograph of the whole workstation at the moment something breaks, so the engineer can examine the scene afterwards.

!
Common Mistake

Enabling snapshot features without considering privacy. Snapshots can capture variable values, which may include personal or confidential data. Restrict access, limit retention and check your data protection rules first. Also confirm that the feature supports your language, runtime and hosting platform, since support varies and changes.

i
Good to know

Use these tools after the telemetry has narrowed the problem to a specific operation. They answer “which line”, while the earlier views answer “which service and which request”.

17Sampling and Controlling Data Volume

Collecting everything is expensive. Collecting smartly is usually enough.

Busy applications can produce a huge volume of telemetry. Sampling reduces it by keeping only a percentage of items while preserving statistical accuracy. The system keeps related items together, so if a request is kept, its dependencies and exceptions are kept too, which means traces remain complete. Metrics that were pre-aggregated before sampling stay exact.

Type

Adaptive sampling

Automatically adjusts the sampling rate to keep the volume near a target, so quiet periods keep everything and busy periods keep a fraction.

Type

Fixed-rate sampling

Keeps a constant percentage that you choose, giving predictable volume and cost.

Type

Ingestion sampling

Applied by the service at the point of arrival, as a last resort when you cannot change the application. It reduces storage but not the data sent over the network.

Tool

Filtering and processors

Drop noisy, low-value items, such as health check requests or successful calls to a chatty internal service, before they are sent.

Tool

Daily cap

A hard limit on daily data volume, to stop runaway costs. When reached, data collection stops until the next day.

Simple Analogy

A pollster does not call every voter; they call a well-chosen sample and still predict the result accurately. Sampling telemetry is the same: keep a representative slice, and keep complete stories for the slices you keep.

flowchart TD
  A["Telemetry volume too high or too costly"] --> B{"Can you change the application?"}
  B -->|Yes| C["Use adaptive or fixed-rate sampling in the SDK"]
  B -->|No| D["Use ingestion sampling or collection rules"]
  C --> E["Filter noisy items such as health probes"]
  D --> E
  E --> F["Keep errors and slow requests at higher fidelity"]
  F --> G["Set a daily cap as a safety net"]
        
FIG 7 — A practical approach to reducing telemetry volume
!
Common Mistake

Relying on a daily cap as the main cost control. When the cap is hit in the middle of the day, you go blind during exactly the busy period or incident when you most need data. Use sampling and filtering for normal control, and keep the cap only as a safety net.

i
Practical Rule

Sample noise, never signal. Keep all errors and the slowest requests, and sample the high-volume successful fast requests that look alike.

18Security, Privacy and Network Isolation

Telemetry can contain sensitive details, so treat it as sensitive data.

Who can see and send data

Control

Role-based access

Built-in roles control who can read telemetry, change settings or publish metrics. Grant the narrowest role that works, using groups.

Control

Identity-based ingestion

Instead of trusting anyone who holds the connection string, the resource can require applications to authenticate with Microsoft Entra ID to send telemetry, and disable local authentication.

Control

Workspace access modes

Control whether people can see all data in a workspace or only data for resources they already have rights to.

Control

Private networking

A private link scope for Azure Monitor lets applications send and query data through private endpoints in your virtual network, with public access disabled for ingestion and queries.

Control

Encryption and customer-managed keys

Data is encrypted at rest by default, with options for your own keys through dedicated cluster arrangements where required.

flowchart LR
  A["Application in virtual network"] --> B["Private endpoint"]
  B --> C["Azure Monitor private link scope"]
  C --> D["Application Insights and Log Analytics workspace"]
  E["Public internet"] -.->|Blocked when public access is disabled| D
        
FIG 8 — Sending and querying telemetry privately through a private link scope

Protecting personal data

Telemetry can accidentally capture sensitive details: email addresses in request addresses, names in exception messages, tokens in headers, card numbers in log text. Prevent it at the source: avoid logging sensitive values, mask or remove them using processors before sending, and review custom properties during code review. Also set retention appropriate to your policies, and know how to delete data if a person exercises a privacy right.

Simple Analogy

Telemetry is like the black-box recorder on an aircraft. It is extremely valuable, but it also records conversations. You decide in advance what must never be recorded, and you lock the recorder in a safe with a short list of authorized people.

ANTI-PATTERN-03 Avoid
Problem

The application logs entire request bodies and authorization headers to help debugging, and the telemetry is readable by everyone in the engineering department.

Why It’s Harmful

Passwords, tokens and personal data are copied into a broadly accessible store and kept for months, creating a data breach waiting to happen.

Correct Approach

Log only what is needed, redact sensitive fields before sending, restrict access by role and set retention to match your data policies.

i
Good to know

If you move to private-only access, plan for everything that needs to reach the monitoring resource: build agents, developer machines, external dashboards and partner tools. Test with a small scope before switching public access off.

19Workspace Design, Retention and Environments

How you organize resources decides how easy investigation, access control and billing will be.

DesignStrengthWeakness
One workspace per application and environmentClear ownership, simple cost attribution, tight access controlMany workspaces to manage, harder cross-application queries
One shared workspace for many applicationsEasy cross-application and cross-infrastructure queries, fewer resourcesAccess control needs care, noisy teams affect others, costs blur
Central workspace per environment typeBalanced: production separated from non-production, shared toolingNeeds strong naming, tagging and role-name discipline

Separate production from the rest

Send development and test telemetry to different resources, or at least different workspaces, from production. This keeps test noise out of production dashboards and alerts, allows different retention and cost controls, and prevents test data from triggering real on-call pages.

Retention and archiving

Telemetry is kept for a retention period that you configure. Newer workspace-based setups include a default period for application tables at no extra retention charge, with longer interactive retention and low-cost archive options available at additional cost. Check current limits and prices. Keep detailed data only as long as it is useful for investigation, usually weeks to a few months, and archive or export summaries for long-term trend and audit needs.

Simple Analogy

Recent security footage is kept at hand for quick review, and older footage is moved to a cheaper storage room, retrieved only when needed. Keeping every second of footage in the front office forever would cost far more than it is worth.

i
Practical Rule

Use consistent naming for resources, cloud role names and environment labels from the start. Retrofitting a naming convention across dozens of services after an incident is painful.

20Cost Management

Monitoring bills grow quietly. Understand what you pay for and steer it.

The main cost is data ingestion: you pay by the amount of data stored in the workspace, measured in gigabytes. Retention beyond the included period, archive storage, certain test types, alert evaluations and queries on some data plans add smaller charges. Commitment tiers, where you agree to a daily volume in exchange for a lower per-gigabyte price, can reduce cost for steady high volumes. Pricing details change, so check the current official pricing page before budgeting.

1

Find where the volume comes from

Query the workspace for data volume by table, application and operation. Usually a few sources create most of the bill.

2

Reduce noise at the source

Filter health probes, sample high-volume successful requests, lower the verbosity of trace logs and remove duplicated logging.

3

Right-size logging levels per environment

Verbose logging may suit development, but production usually needs warnings and errors plus sampled information messages.

4

Choose the right pricing option

Consider commitment tiers for steady volumes and lower-cost data plans for high-volume, rarely queried logs, where supported.

5

Set budgets and alerts on spend

Alert when ingestion rises abnormally, since a sudden increase often signals a bug such as an exception loop.

6

Review retention

Shorten retention for noisy, low-value data and move long-term needs to cheaper archive or export.

Simple Analogy

Recording every conversation in a building would fill warehouses with tape. You record what matters: entrances, incidents and anything unusual. The art of monitoring cost is deciding what truly matters to record.

!
Common Mistake

Leaving debug-level logging switched on in production after an investigation. Ingestion jumps for months until someone notices the invoice. Make verbosity part of the release checklist and alert on sudden increases in volume.

21Integrations: DevOps, Chat, Dashboards and Automation

Monitoring is most valuable when it connects to how teams already work.

Integration

Release annotations

Pipelines mark deployments on charts so that a change in behavior can be linked to a specific release at a glance.

Integration

Work item creation

Create bugs or tasks in the team’s tracking tool directly from an exception or a trace, with the context attached.

Integration

Chat and incident tools

Action groups post alerts to team chat channels and incident management tools, starting the right on-call process.

Integration

Automation and logic workflows

Alerts can trigger automated remediation, such as scaling out a service, restarting an instance or opening a ticket.

Integration

External visualization and reporting

Query results can feed business intelligence and open-source dashboard tools for broader audiences.

Integration

Data export

Workspace data can be exported to storage or streaming services for long-term retention or analysis in other systems. Older continuous export features have been retired, so use the current export options.

flowchart LR
  A["Deployment pipeline"] -->|Release annotation| B["Application Insights"]
  B --> C["Alert fires"]
  C --> D["Team chat channel"]
  C --> E["On-call incident tool"]
  C --> F["Automation: scale or roll back"]
  B --> G["Create work item from exception"]
        
FIG 9 — Monitoring connected to deployment, communication and automation
Simple Analogy

A smoke detector that only beeps in an empty house is of little use. Connected to the building’s alarm panel, the fire brigade and the sprinklers, it becomes a complete safety system.

22Troubleshooting Missing or Strange Data

When telemetry does not show up, follow a checklist from the application outward.

SymptomLikely causeWhat to do
No data at allWrong or missing connection string, instrumentation not startedCheck the configuration value in the running environment, and confirm startup logs
Data from one environment appears in anotherShared or copied connection stringUse separate resources or workspaces and configure per environment
Data delayed by many minutesNormal ingestion latency, buffering, network problemsWait, then check connectivity from the host to the ingestion address
Short-lived job shows nothingProcess exited before buffered data was sentFlush or shut down the telemetry pipeline cleanly before exit
Telemetry stops mid-dayDaily cap reached, quota or throttlingCheck cap settings and ingestion volume, adjust sampling
Fewer records than expectedSampling activeReview sampling settings, and rely on pre-aggregated metrics for counts
Missing traces across servicesContext not propagated through messages or custom clientsVerify trace headers and message properties are passed along
Browser data missingScript not loaded, blocked by ad blockers or privacy settings, consent not givenCheck script loading in the browser, and consent flow
Data not arriving behind a firewall or private networkOutbound rules or private link configuration blocking ingestionAllow required endpoints or configure private link scope and DNS correctly
Unauthorized or rejected telemetryIdentity-based ingestion required but application does not authenticateConfigure identity for the application with the correct role
i
Practical Rule

Enable the SDK’s self-diagnostic logging temporarily when telemetry is missing. It prints what the instrumentation is doing and any errors sending data, which usually points directly at the cause.

ANTI-PATTERN-04 Avoid
Problem

The team assumes monitoring works because the resource exists, and never verifies that data from each environment actually arrives and that alerts fire.

Why It’s Harmful

A misconfiguration is discovered only during the first real incident, when it is too late and nobody can see anything.

Correct Approach

Verify telemetry and test alert delivery as part of every deployment checklist, and monitor the monitoring, for example by alerting when expected telemetry stops arriving.

23Patterns and Anti-Patterns

Habits that make monitoring valuable, and habits that make it noise.

Patterns worth adopting

Service level objectives

Agree on targets such as “ninety-nine percent of checkout requests succeed within two seconds” and alert on how fast the error budget is being used, not on every blip.

Golden signals

For every service, track latency, traffic, errors and saturation. These four signals reveal most problems with little effort.

Structured, correlated logging

Write logs with consistent fields and attach the operation identifier, so that logs and traces connect effortlessly.

Health endpoints with dependency checks

Expose lightweight health checks that verify critical dependencies, and use them for availability tests and load balancer decisions.

Monitoring as code

Define resources, alert rules and workbooks in version-controlled templates, so that every environment is consistent and changes are reviewed.

Post-incident improvement loop

After every incident, ask what signal would have told us sooner, then add it. Monitoring improves with each lesson.

Anti-patterns to avoid

ANTI-PATTERN-05 Avoid
Problem

Alerts and dashboards are created by hand in the portal, differently in each environment, with no record of who changed what.

Why It’s Harmful

Production and test drift apart, alerts disappear silently and nobody can rebuild the setup after a mistake or a regional rebuild.

Correct Approach

Manage monitoring configuration through templates and pipelines with review and history.

ANTI-PATTERN-06 Avoid
Problem

Teams monitor only servers and infrastructure counters, and ignore request failures, latency and user journeys.

Why It’s Harmful

Machines look healthy while customers cannot check out. Problems are noticed only through complaints.

Correct Approach

Monitor from the user’s point of view first, with infrastructure data as supporting evidence.

ANTI-PATTERN-07 Avoid
Problem

Every message in the code is logged at the highest verbosity and sent to Application Insights in all environments.

Why It’s Harmful

Costs balloon, real errors drown in noise and queries become slow.

Correct Approach

Use severity levels deliberately, keep production verbosity modest, and enable detailed logging temporarily and selectively.

“Good monitoring does not show you everything; it shows you the right thing at the right moment.”

24Best Practices Checklist

A review list before going to production and at regular intervals afterward.

Do

  • Create workspace-based resources and separate production from non-production
  • Use the connection string, stored in configuration and not in code
  • Prefer the OpenTelemetry-based approach for new applications, and confirm current support
  • Set a unique cloud role name for every service
  • Alert on user-facing symptoms with owners, severity and runbooks
  • Add external availability tests for key journeys from several regions
  • Use sampling and filtering, keeping errors and slow requests
  • Redact sensitive data and restrict access by role
  • Annotate releases and compare before and after
  • Manage monitoring configuration as code
  • Review costs and alert quality regularly

Avoid

  • Relying on averages instead of percentiles
  • Using the daily cap as the main cost control
  • Logging personal data, secrets or entire request bodies
  • High-cardinality metric dimensions
  • Sharing one connection string across all environments
  • Using features and test types already retired or ending
  • Alerts without owners, which become noise
  • Assuming monitoring works without verifying it
  • Leaving debug logging on in production
i
Practical Rule

Hold a short monitoring review every quarter: which alerts fired, which were useless, which incidents were found by customers first, what is the biggest cost driver and which retirement notices apply. Small, regular tuning keeps the system healthy.

25Real-World Scenarios

How teams use Application Insights day to day.

E-commerce sale-day readiness

Before a major sale, a retailer runs load tests while watching live metrics, checks percentile latency per operation, tunes sampling so volume stays predictable, and sets alerts on checkout failure rate. During the sale, the application map reveals a slow payment provider within minutes, and traffic is shifted to a backup provider.

Release regression caught early

A team deploys a new version, sees the release annotation on the chart, and spots a jump in failures for one operation within minutes. Transaction diagnostics shows a new database call timing out. The release is rolled back and a fix prepared, with only a small number of users affected.

Microservices with distributed tracing

A bank with dozens of services gives each a clear role name and propagates trace context through queues. When customers report slow transfers, support copies the operation identifier from the app, and engineers see the full trace and the one overloaded service.

Cost reduction project

A company discovers that health probe requests and verbose trace logs account for most of its monitoring bill. Filtering probes, lowering log levels and applying sampling cut volume sharply, while error and slow request visibility stay intact.

Product decisions from usage data

A software team uses funnels to see that many users abandon a sign-up form at the same step. A small redesign of that step improves completion, and retention views confirm that new users now return more often.

Secure, private monitoring for a regulated workload

A healthcare provider sends telemetry through private endpoints, requires identity-based ingestion, redacts patient identifiers before sending, and restricts query access by role. Auditors can see exactly who can access monitoring data.

26Frequently Asked Questions

Short answers to common beginner questions.

Q1What is Application Insights in one sentence?

It is the application performance monitoring feature of Azure Monitor, collecting requests, dependencies, exceptions, logs, metrics and usage data so that you can detect, diagnose and understand problems and behavior in running applications.

Q2How is it related to Log Analytics?

Modern Application Insights resources are workspace-based, which means telemetry is stored in a Log Analytics workspace. You can query it with the same language and combine it with other logs.

Q3Do I have to change my code to use it?

Not always. Many hosting platforms offer auto-instrumentation through a setting. For custom events, filtering and finer control, you add a library to your application.

Q4What is the connection string?

It is a piece of text that tells instrumentation where to send telemetry. It replaces the older instrumentation key for ingestion. Keep it in configuration and use a different one per environment.

Q5What is distributed tracing?

It follows one request across many services by passing a shared identifier, so that all the work done for that request can be reassembled and viewed as a single timeline.

Q6Why does the application map show everything as one box?

Usually because services share the same cloud role name. Give each service a distinct role name so that they appear as separate components.

Q7Why are there fewer records than my real request count?

Sampling is probably active. Detailed records are reduced, while standard metrics are pre-aggregated and remain accurate, so use metrics for counts and rates.

Q8How do I know if my application is down?

Use availability tests that call your application from several locations, and alert when several locations fail. A dead application cannot report its own absence.

Q9How do I reduce cost?

Find the top sources of volume, filter noise such as health probes, apply sampling, lower production log verbosity, consider commitment tiers where they fit, and alert on sudden increases.

Q10Can I keep monitoring traffic private?

Yes, using a private link scope for Azure Monitor and private endpoints, optionally with public access disabled and identity-based ingestion. Plan DNS and exceptions carefully.

Q11Is it safe to log user data?

Treat telemetry as sensitive. Avoid logging personal data or secrets, redact before sending, restrict access, and set retention according to your policies and regulations.

Q12Which instrumentation approach should I use for a new application?

Microsoft has been steering new work toward the OpenTelemetry-based approach, with auto-instrumentation as a quick start. Check the current recommendation for your language before deciding.

Q13Is the guidance in this article permanent?

The concepts are stable, but features, test types, SDK recommendations, table names, pricing and retirement dates change. Confirm details in the current official documentation before finalizing a design.

27Summary and Key Takeaways

Application Insights gives your applications a dashboard, a diagnostic port and a bell. Instrumentation collects requests, dependencies, exceptions, logs, metrics and usage data. That data travels to a Log Analytics workspace, where built-in views such as the application map, failures, performance and live metrics help you see what is happening, and the query language lets you ask any question you can think of. Distributed tracing connects the work of many services into a single story. Availability tests watch from the outside, and alerts tell the right people at the right time. Sampling, filtering and sensible retention keep cost under control, while role-based access, identity-based ingestion, redaction and private networking keep the data safe. Because Azure Monitor and its standards keep evolving, hold on to the lasting ideas in this guide and verify the details in current documentation. With those habits, monitoring stops being a cost and becomes the way your team ships with confidence.

Key Takeaways

  • Monitor from the user’s point of view — requests, failures, latency percentiles and availability matter more than raw server counters.
  • Use workspace-based resources — telemetry lives in Log Analytics, enabling cross-resource queries, shared security and unified cost control.
  • Instrument deliberately — start with auto-instrumentation, adopt the OpenTelemetry-based approach for new work, use the connection string, and give each service a clear role name.
  • Trace across services — propagate context everywhere, including queues, so that one operation identifier tells the whole story.
  • Alert on symptoms with owners — fewer, trusted alerts with severity routing and runbooks beat many noisy ones.
  • Control volume and protect data — sample noise not signal, filter probes, avoid logging sensitive values, restrict access and consider private connectivity.
  • Keep verifying and updating — test that data and alerts actually work, review costs regularly, and watch retirement notices and current recommendations.