App Insights — telemetry from inside
Everything Class Twenty-Eight collected watched from outside: the platform's view of your resources — CPU numbers, blob operations, job executions. What it cannot see is the inside of the application: which HTTP request was slow, which database call it was waiting on, which exception fired on which line. Application Insights is Azure Monitor's instrument for that interior view — wire it into the storefront (for many platforms, without touching code; for the rest, a small OpenTelemetry package and a connection string) and the app begins narrating its own execution into the same workspace family you already query.1
- App Insights
- Application performance monitoring from instrumented code. Collected requests, dependency calls, and exceptions can be correlated to show where a slow checkout spent its time. Sampling and instrumentation settings determine which records are available.
Four telemetry types carry most of the value, and they interlock. Requests: every call your app served, with duration and result. Dependencies: every call your app made — SQL, storage, third-party APIs — which is where most slowness actually lives. Exceptions: every error, with stack trace. Traces: the app's own log lines, stitched to the request that produced them. The stitching is the product: one slow checkout request expands into its dependency calls and exceptions as a single correlated story, and the application map draws the whole system — services, dependencies, failure rates on every edge — from that telemetry automatically. Class Twenty-Nine's skills apply unchanged; these are just richer tables.
Custom events and metrics — the telemetry you write
The four automatic types carry the plumbing; the two you add by hand carry the business. A custom event is a named thing that happened in your domain — cart-abandoned, coupon-applied, checkout-completed — recorded in a line of code with a bag of properties attached: which coupon, which store, which basket size. A custom metric is a number you emit per transaction or on a schedule — queue depth, active carts, dollars per order — pre-aggregated at the source so it costs little and charts fast. The distinction that catches people: an event is a record you can slice and count any way you like afterward; a metric is a number already summarised — cheaper to keep, but no longer decomposable into the transactions that made it. Instrument the events your business would ask about in a meeting, because the platform will never know that "coupon applied" matters. That half of the model is yours to name, and naming it well is a quiet part of what a cloud engineer is paid for.
Distributed tracing — one operation across many services
Suppose the storefront calls a pricing service, which calls a database. With compatible distributed-tracing instrumentation, those components propagate trace context, and Application Insights can connect their telemetry through an operation identifier. An end-to-end view may then show where a slow request spent time. Missing instrumentation, broken propagation, or sampling can leave gaps. Check that the services appear in the same trace before drawing a conclusion from the application map.
Live Metrics — watch a deployment
Regular telemetry takes time to ingest and query. Live Metrics provides a near-real-time view of supported request, failure, and performance signals from instrumented instances. During a deployment, watch it alongside your other health checks and deployment gates. A blank or healthy Live Metrics view is not proof of a healthy release: confirm that the new instances are connected, traffic is reaching them, and the expected signals are present before deciding whether to continue or roll back.
Sampling — why the bill and the traces shrink together
Sampling can reduce telemetry volume and cost, but it also means an individual request might not be stored. Some SDKs support adaptive sampling before data leaves the application; ingestion sampling acts after data reaches Azure. Check the settings of your actual instrumentation rather than assuming either is enabled. Aggregated counts may need the telemetry's sampling weight, and an absent trace cannot prove a particular customer request never happened. If you need a complete audit or billing record, design and validate that record separately from sampled monitoring telemetry.
Availability tests — the robot customer
All telemetry so far shares a blind spot: it reports what happened to traffic that arrived. If DNS breaks, the certificate expires, or the front door falls off the internet, the app records nothing wrong — no requests, no errors, a peaceful dashboard over a dead site. The fix is a customer who never sleeps: an availability test, which requests your URL on a schedule from multiple Azure regions around the world and records success, failure, and response time from each.
A standard test requests a public URL and can check its response code, page content, and TLS certificate. A content match helps catch a page that returns HTTP 200 but does not show the expected content. A proactive certificate check can warn before expiry when configured and its alert reaches someone. Microsoft recommends at least five test locations and an alert threshold of at least three failures out of five; for more locations, its guidance is locations minus two.2 Multiple locations reduce pages caused by one failing test location, but the tested URL and content must still represent what customers need.
Action groups — where alerts go
Detection without delivery is a diary. Azure separates the two cleanly: an alert rule is scope + condition (a metric threshold, a failed availability test, or a Class Twenty-Nine log query on a schedule), and an action group is a named, reusable list of destinations — email, SMS, push, a webhook into Teams or Slack, an ITSM ticket, even a Logic App or Azure Function that does something. Rules reference action groups, many-to-one, so "who gets told" is maintained in one place instead of inside forty rules:
# one action group, reused by every alert that pages on-call
az monitor action-group create \
--name ag-campux-oncall \
--resource-group rg-campux-platform \
--short-name oncall \
--action email oncall-primary oncall@campux.co
Two disciplines make the machinery trustworthy. First, define what each severity means for your team: which conditions page on-call and which wait for business hours. Azure labels alert severity from Sev0 to Sev4, but the label alone does not set the recipient or response time. Second, give each rule an owner and an action group that reaches that owner. A rule can be configured as stateful, so it fires when the condition begins and resolves after the signal recovers; verify that behavior in the rule instead of assuming every alert works that way.
One more piece of machinery earns its line: an alert processing rule can suppress notifications for a scope and a window — the Saturday-night storefront maintenance, the planned failover test — so the work proceeds without paging anyone and the rules themselves stay armed. The alternative, disabling alerts by hand and re-enabling them from memory, is how monitoring acquires permanent holes.
Metric alerts, log alerts, and a threshold that learns
A rule's condition comes in a few shapes. A metric alert evaluates a stored time series such as CPU or request failures at the frequency you configure. A log alert evaluates a KQL result on a schedule; it can ask more specific questions, but ingestion and evaluation can delay the notification, and pricing depends on the rule and data plan. An activity log alert watches events such as resource changes or service-health advisories. Choose the signal that directly answers the operational question, then inspect the configured frequency and cost.
| Rule type | Watches | Latency | Reach for it when |
|---|---|---|---|
| Metric alert | a metric time series | configured evaluation frequency | a metric directly answers the question; inspect the supported scope and pricing |
| Log (search) alert | a scheduled KQL query result | evaluation plus ingestion delay | the question needs records, strings, or a calculation over logs |
| Activity log alert | control-plane or service-health events | event delivery varies | a resource changed or Azure reported service health |
Static thresholds need tuning against normal workload behavior. Dynamic thresholds are supported for many metric signals and log-query results, but they need enough history and have configuration limits. They identify deviations from a learned pattern; they are less suited to slowly worsening conditions, and a new resource may not alert until enough data exists. Start with the customer impact you need to detect, then test both the threshold and the notification path.
Smart detection — the alerts you did not write
Some failures announce themselves without a rule. Smart detection watches an app's telemetry for anomalies you never thought to threshold — a sudden rise in failed requests, a creeping response-time degradation, a spike in exceptions against one dependency — using the app's own recent behaviour as the baseline, and emails when the pattern breaks. Treat it as a smoke detector, not a strategy: it catches the class of problem nobody wrote a rule for, but it does not know your business, cannot be trusted to page on-call, and earns a severity only after the same §4 examination every deliberate alert must pass. It is a useful second net beneath the three chosen alerts — and a poor substitute for choosing them.
Alert fatigue — the graveyard
Here is where monitoring programs actually die. Not from missing tools — from a pager that cried wolf. The failure sequence is always the same: enthusiasm creates forty alerts; half fire on conditions that need no action; on-call learns, correctly, that most alerts mean nothing; the learning generalises; and eighteen months later a real Sev0 scrolls past unread in a channel nobody has muted only because muting felt like admitting it. The team then buys a new monitoring tool, and the cycle restarts with better dashboards. Alert fatigue is not a personnel problem. It is a signal-to-noise problem, and it is designed in or designed out.
Every alert is a claim on someone's attention.
- Actionable
- There is something a human should do upon receiving it — and the alert says what, ideally with a runbook line. "FYI, CPU was briefly high" is not an alert; it is a chart that belongs on a dashboard, per §5.
- Owned
- A named person or rotation answers it. An alert routed to a twelve-person alias is owned by nobody — everyone assumes someone else is looking, and everyone is right.
- Rare
- It fires only when the condition is real: thresholds tuned to actual behaviour (not defaults), state-based so one incident is one notification, and reviewed on a cadence where anything that fired without requiring action gets retuned or deleted — the same ratchet as Class Twenty-Nine's query pack, run in reverse.
Before a rule pages someone, ask whether the condition requires action now, who owns that response, and what they should do first. Use the team's severity policy to choose the notification route. Review firing history after deployment: a quiet rule that misses real failures also needs repair. The right number of alerts depends on the service and its risks.
Play it through
Three minutes, one pager. Take the noisy alert off it, then wire the rule to what a customer actually feels. It plays on its own and stops when it needs your hands.
Dashboards that answer questions
What happens to everything that failed the 3am test? It becomes glanceable instead of interruptive — and here too there is a discipline separating useful from decorative. The decorative kind is familiar: a wall of sixteen charts, assembled in week one and understood by nobody by month three, whose actual function is looking impressive behind the team during video calls. The useful kind is built backwards from questions. Before adding any panel, name the question it answers and who asks it: Is checkout healthy right now? (on-call, hourly). Did last night's batch run? (the storefront team, each morning). Is ingestion cost drifting? (the platform lead, monthly). If no one asks the question, the panel does not earn the pixels.
Azure's tool for this is the workbook — an interactive document mixing prose, parameters, and live Class Twenty-Nine queries, closer to a runbook with charts than to a TV wall. The strongest pattern wires the layers of this class together: the alert tells you something is wrong; the workbook it links to shows the affected service's requests, dependencies, and recent deploys side by side — the first three investigation queries pre-run before the engineer has poured coffee. Alerts interrupt; dashboards answer; workbooks investigate. Keep the three jobs separate and each stays good at its own.
Three alerts, on purpose
Campux wires App Insights into the storefront and gets its interior view — and the application map promptly earns its keep, showing checkout's latency living almost entirely in one database dependency nobody had suspected. Then the alerting review, and the number that matters: after a long argument, the team ships three alerts, total.3 A standard availability test on checkout from five regions, content-matching the order button, alerting at three-of-five failures — Sev1, pages on-call, runbook line: check the availability workbook, then App Service status. The Class Twenty-Nine disk-space-low query, scheduled — Sev2, Teams channel, owner: platform. And a failed-execution alert on the POS job — Sev2, storefront team, runbook: rerun via job start after reading the execution log.
In this teaching scenario, routine CPU and memory signals stay in workbooks, while three customer or operations failures have named owners and first actions. Imagine the availability test later failing from three locations after a DNS change. The team still has to verify the alert rule fired, the action group delivered, and the owner responded; a diagram or severity label cannot establish any of those outcomes.
The official pages, and a CAMPUX overview
Application Insights overview
learn.microsoft.com/azure/azure-monitor/app/app-insights-overview
Application Insights availability tests
learn.microsoft.com/azure/azure-monitor/app/availability
Stand up an availability test and watch it judge a real site
You need a public page you control. If you do not have one, deploy the twelve-line origin app from Class 13 Part B on a free plan: its home page contains Campux storefront, which you can expect, then deliberately mismatch. Create a workspace-based Application Insights resource and test a public page you own or have permission to monitor. Use an address whose content you can change or whose expected text you can deliberately mismatch. The test checks that one URL; it does not prove an entire checkout journey works.
Create the workspace-based App Insights resource:
az group create --name rg-alert-lab --location eastus az monitor log-analytics workspace create \ --resource-group rg-alert-lab --workspace-name alert-lab-logs az monitor app-insights component create \ --app campux-availability --location eastus \ --resource-group rg-alert-lab \ --kind web --application-type web \ --workspace $(az monitor log-analytics workspace show \ -g rg-alert-lab -n alert-lab-logs --query id -o tsv)Before running: select your intended Azure subscription in Cloud Shell Bash. Choose a resource group and names that do not collide with existing resources. Application Insights uses the Log Analytics workspace for ingested telemetry; creating the resource alone does not instrument your site. If the CLI asks to install the application-insights extension, allow it.In the portal: open campux-availability → Availability → Add Standard test. Fill it in deliberately:
Test name: checkout-availability URL: https://<a-public-page-you-control>/ Test frequency: 5 minutes Test locations: pick 5, on different continents SSL check: enabled · Proactive lifetime check: 14 days Content match: a word you know is on the page
What to notice: five locations let you set a multi-location failure threshold. Content matching checks for the expected text even if the server returns HTTP 200. A certificate lifetime check can warn before expiry if its alert is configured and delivered.Wait ten minutes, then open the Availability graph and flip to Scatter Plot.
On screen: inspect results by location, response time, and failure details. The first result can take longer than ten minutes; check the test status before diagnosing an empty chart.Now make it fail honestly: edit the test and change the content match to a string that is not on the page (e.g. campux-canary-xyzzy). Wait ten minutes and reload.
The lesson: if the page still returns HTTP 200 but lacks the expected string, the content check should fail after the edit reaches the test agents. Confirm the actual test result and failure reason, then restore the correct string before Lab 2.
Route the alert to your inbox, fire it, then apply the 3am test
Create an action group, verify the email receiver, and test delivery. Then connect the group to the availability rule and deliberately fail the test again. The alert and email must both be checked; a visible failure alone does not prove delivery works.
Create the action group with your own address:
az monitor action-group create \ --name ag-lab-oncall \ --resource-group rg-alert-lab \ --short-name oncall \ --action email me <your-email>
Check delivery: Azure may send a receiver verification email. Complete any one-time-code step promptly, then open the action group in the portal and use Test to send a notification. Check the inbox and spam folder. A created group alone does not prove that email delivery works.Attach it to the availability alert: in the portal, Availability → your test's context menu → Open Rules (Alerts) page → open the rule → Edit. Set severity to Sev1, add ag-lab-oncall as the action group, and confirm the condition reads 3 of 5 locations.
Verify: the availability experience normally creates an alert rule, but inspect the rule rather than assuming its scope, location threshold, stateful behavior, or action group. Save it and re-open it to confirm the chosen settings persisted.Break the content match again (your canary string), and wait for the phone to buzz.
Verify both sides: wait for the failure to appear in the test results, then inspect Azure Monitor → Alerts for a fired rule and your inbox for its notification. Delivery time varies. If the rule fires but email does not arrive, check receiver verification, action-group attachment, and processing rules. A stateful rule should not send a new fired action on every evaluation while the same condition remains active.Restore the correct content match. Confirm a healthy test result and, if configured, the alert's resolution. Then clean up:
# the 3am test, applied honestly: # would you wake a colleague for this site being down? if not, # for a practice site, do not leave a paging rule running. az group delete --name rg-alert-lab --yes --no-wait
The lesson: check the whole chain: test result → alert rule → action group → verified receiver. The delete command starts an asynchronous operation; confirm the lab resource group is gone in the portal or CLI. Decide whether a production alert deserves an interrupt based on customer impact and ownership, not on a fixed severity label.
Zoom out: an alert is a promise to wake someone — spend it carefully
You can instrument an app and fire an alert. Now reason about what alerting does to the whole team, because a pager that cries wolf is a pager everyone learns to sleep through.
Every proposed alert feels prudent, so alerts multiply, so the pager cries wolf, so people mute it — and the one real page is the one they slept through. What keeps each alert meaningful?
An alert depends on the telemetry, the threshold, and the action group behind it; a page with no owner and no runbook is noise with a phone number.
The team’s trust in the pager is the real asset; every low-value alert spends it, and it does not refill quickly.
An availability test that checks a static page reports healthy while orders fail — the alert measures the wrong thing and lies confidently.
Per-resource alerts hand-made at ten become an ungoverned swamp at a thousand; the discipline is fewer, each owned, each with a first move written down.
The engineer who ships is asked "did it alert?" The engineer who gets promoted is asked "and does anyone still believe the pager?" — and kept it to three that fire.
Quiet alerting is a feature
You are done hearing about outages from customers first. You wire Application Insights and set three alerts that matter — not forty that get ignored — so a real failure pages someone with signal instead of noise. The next incident starts with a page at the first sign, not a support ticket an hour in. Quiet alerting is a feature, and you built it.
Examination
Four drills, then two situations. The situations have no marking scheme — write your answer before you reveal the reasoning, or the exercise is worthless. Nothing is stored; this is between you and the page.
B. The request row says that checkout took 2.1 seconds; the dependency rows say why — 1.8 of them waiting on one SQL call, which is precisely how the case file's mystery got solved. A stops at the total (necessary, not sufficient); C conflates slow with broken — most slowness raises no exception at all; D measures from outside and can only confirm the slowness, not localise it. The professional habit this drill encodes: when someone says "the app is slow," your first move inside App Insights is the dependency view of a slow transaction, because in real systems the app is rarely slow — something the app waits on is.
C. One failed test location might reflect a route or test-agent problem. A three-of-five threshold asks whether the failure is visible from several locations before notifying someone. Microsoft recommends at least five locations and this threshold pattern. It reduces noise, but it does not prove that all customers are affected or that a static test covers checkout. A, B, and D describe mechanics the test does not have.
Unactionable, unowned, untuned — the three failures of §4's checklist, inverted. Each teaches the same lesson: on-call ignores alerts because ignoring them has been the correct response, repeatedly. An FYI alert trains "reading this changes nothing"; an alias-routed alert trains "someone else has it"; a threshold that fires on normal Tuesday traffic trains "red is the usual colour." The rejects are backwards on purpose: scarcity is the cure — three meaningful alerts hold authority precisely because each one has always meant something — and severity levels reduce anxiety rather than cause it, because a defined Sev2 tells you exactly how fast you must move. Fatigue is never caused by the humans who stopped responding; it is caused by the system that taught them to.
# memo: storefront alerting plan
1. Availability: standard test on checkout, 5 locations,
alert at 3/5 failures — Sev1, pages on-call.
2. Errors: every individual 5xx response emails the
engineering@ alias — Sev0, so nobody misses one.
3. Batch job: failed execution alerts the storefront team —
Sev2, runbook: rerun after reading the execution log.
4. Disk: the disk-space-low query, scheduled — Sev2,
platform channel.
Line two — it fails all three §4 tests at once, at volume. Individual 5xx responses happen in the healthiest systems — a bot probing, a client timeout, a transient retry — so this rule fires constantly on normality (untuned). It goes to an alias, so no one owns any given firing (unowned). And there is nothing to do about one 500 (unactionable). The cruellest part is the stated motive: "Sev0 so nobody misses one" achieves the exact opposite, because a Sev0 that fires hourly redefines Sev0 as noise — and the day line one's genuine Sev1 fires, it arrives in an inbox trained to skim past red. One bad rule does not merely waste attention; it devalues the currency the good rules spend.
The repair keeps the intent and fixes the mechanics: alert on the error rate — 5xx above a tuned threshold over a window, corroborated the way Drill 02 taught — Sev1, routed to the owned on-call group, with the per-error detail living in a workbook the alert links to. The other lines are the case file, and they are healthy: availability paging on-call (A), runbook lines in alerts (C — they are exactly where runbooks belong), and scheduled log-query alerts (D) are all standard machinery. Reviewing an alerting plan is §4's checklist applied line by line; one firehose fails the whole plan, because attention is shared infrastructure.
The trap is the premise — ignoring forty alerts was the correct decision, thirty-nine times. Say it plainly: on-call did not fail to take alerts seriously; on-call learned, from months of evidence, that these alerts do not merit seriousness — and last night they were right thirty-nine times out of forty. Retraining people to respond to noise does not make the noise signal; it makes the people slower and resentful, and it lasts until the next quiet week undoes it. A system that fires forty times a night has a design defect, and the one missed real alert is the defect's cost, not the on-call engineer's.
Run the triage that should have existed: the 3am test over all forty, with the data. Pull last month's firing history and put every rule through §4's three questions — actionable, owned, rare — with its actual numbers attached: fired N times, acted on M. The arithmetic is usually devastating and therefore persuasive: most rules will show M = 0, and a rule acted on zero times in ninety days is a dashboard panel wearing a pager. Sort the survivors into the case file's shape — a handful of Sev0/Sev1 rules that page a named rotation with a runbook line, a Sev2 tier that lands in a channel during business hours, and everything else demoted to workbooks. The target number is single digits, and saying the number out loud in the meeting is half the fix.
Then install the ratchet so the graveyard does not refill. Two standing rules: every alert that fires without producing action gets retuned or deleted at a short weekly review, and every new alert must arrive with its owner, severity promise, and runbook line written down — no orphans admitted. Give the manager the reframe they can carry upward: the incident was not "on-call ignored an alert" but "we buried one real signal under thirty-nine false ones, and last night we paid for it." Teams that fix the people have this incident again in six months. Teams that fix the system get what Campux got — a pager quiet enough that nobody has ever learned to sleep through it.
Concede the need before correcting the spec. Leadership's underlying question is real and fair: is the system healthy, and would we know if it weren't? The TV wall is their proposed answer, and the honest critique is that "all our metrics" answers no question at all — sixteen charts require an expert to interpret, decay into wallpaper within a month, and give a false comfort worse than nothing, because a wall that is always slightly red teaches everyone that red is fine (the §4 disease, in visual form). Say yes to the question, and negotiate the answer.
Build the small, honest version: one screen, five panels, each a named question. Is checkout up? (the availability test's last hour — one green/red tile.) Are customers succeeding? (order rate against the same hour last week.) Are we erroring? (5xx rate versus the tuned threshold.) Did the nightly run? (last POS execution's status.) Is anything paging? (open alerts — a number, usually zero.) Every panel passes the §5 test: someone asks it, on a rhythm, and can act on the answer. A non-engineer can read the whole screen in five seconds, which is what an office TV is actually for. Behind it, the team's real workbooks stay parameterised and investigative — different audience, different tool, per §5's separation.
Then close the loop that makes it credible. A health screen is a claim, and claims need audits: the screen shows green because the three real alerts are quiet — so leadership's confidence rests on the alerting discipline of this whole class, and the alert history review is what keeps the green trustworthy. Offer that as the monthly one-line report ("three alerts, two firings, both acted on, mean response four minutes") — a sentence worth more to a director than sixteen charts. The deliverable was never a dashboard; it was justified confidence. Build the smallest thing that delivers it, and the TV wall request will be quietly forgotten by everyone who watches the five tiles actually work.
Five things worth carrying out of this class
- Instrumented applications can send requests, dependencies, exceptions, and traces to Application Insights. Check what your chosen instrumentation actually emits before using it to diagnose a slow transaction.
- Availability tests check a selected public URL from multiple locations. Choose content and certificate checks that matter, then verify both the result and the alert threshold.
- Alert rules detect; action groups route notifications. Set a named owner, verify each receiver, and test whether fired and resolved notifications arrive as configured.
- Every alert must be actionable, owned, and rare — the 3am test decides. Fatigue is a design defect, not a personnel one: on-call ignoring noisy alerts is learning, working exactly as designed.
- Alerts interrupt, dashboards answer, workbooks investigate. Build every panel backwards from a named question and its asker — and treat "deleted an alert" as monitoring work of equal rank with creating one.
- Instrumentation today means OpenTelemetry — the vendor-neutral standard Azure Monitor now builds on — via the Azure Monitor OTel distro for code-based setups, with automatic instrumentation available for several hosting platforms and a JavaScript SDK for the browser side. The moving parts get renamed with some regularity; the concept underneath is stable — a package in the app, a connection string, telemetry out — and OpenTelemetry skills transfer to every observability vendor at once, which makes them unusually good career value. ↩
- Microsoft recommends at least five locations and an alert threshold of three out of five for availability tests. This guards against a single location's failure. It cannot establish that the tested URL covers an entire customer journey. ↩
- Three alerts is Campux's right number, not a universal one — a payments platform or a hospital runs more, a side project fewer. The transferable rule is the ratio, not the count: every alert acted on when it fires, reviewed on a cadence, retired when it stops earning attention. If your firing-to-action ratio drifts far from one, you have either too many alerts or too many incidents, and both are findings. ↩
Instrument an application, set an alert that fires for the right reason, and route it to a person.
Play the lesson above to stamp this class.