SDSystem DesignConcepts to case studies
System DesignDSA
x
0/311
Part 1: Foundations
Part 2: APIs and Communication
Part 3: Caching
Part 4: Data and Storage
Part 5: Architecture
Part 6: Distributed Systems
Part 7: Advanced Data Topics
Part 8: Operations and Security
  • Three Pillars of Observability
  • Logging Best Practices
  • Log Aggregation
  • Metrics and Instrumentation
  • Distributed Tracing
  • Alerts and Monitoring
  • Dashboards and Runbooks
  • SLOs and Error Budgets
  • Incident Management and Postmortems
  • Profiling
  • Audit Logs
Part 9: Estimation and Interview Method
Part 10: Case Studies
System Design/Operations and Security/Observability

Alerts and Monitoring

Watch the system, and wake a human only when something really needs them.

โฑ 13 min readIntermediateMust KnowInterview FavouriteHas visualizer
SummaryConceptReal-Life ExampleWhy?Where?How It WorksStepsKey TermsPros & ConsMistakesReal WorldRead NextInterview Q&ACheat-Sheet

01Quick Summary

Monitoring means watching your system all the time. Alerting means telling a human when something needs their attention.

  • Good alerts are about symptoms users feel (errors, slowness), not about every small cause (a busy CPU).
  • An alert should be urgent, real and actionable. If it is not, it should be a ticket or a dashboard, not a page at 3 a.m.
  • Too many alerts cause alert fatigue: people stop trusting the pager, and miss the one that matters.

02Concept: What is it?

Monitoring collects data (metrics, logs, traces, health checks) and shows it. Alerting is a set of rules on top of that data: "if the error rate is above 5% for 5 minutes, tell the on-call engineer".

The hard part is not sending an alert. It is deciding which conditions deserve one. A noisy alert wastes people's time. A missing alert means users find the problem before you do.

From data to a human
๐Ÿ“ˆMetrics and checks
โ†’โ†“rules
๐ŸงฎAlert rulecondition + duration
โ†’โ†“fires
๐ŸงฐAlert managergroup, dedupe, route
โ†’โ†“
๐Ÿ“ŸOn-call personpage, chat or ticket
Each step can filter, group and route, so the right person gets one clear message.

Page, ticket or nothing?

๐Ÿ“ŸPage (wake someone)
Users are hurt now, or will be soon, and a human can do something about it.
๐ŸŽซTicket (work hours)
Something will become a problem later: disk filling in a week, a certificate expiring in 20 days.
๐Ÿ“ŠDashboard only
Useful for diagnosing, but not a reason to act by itself: CPU level, cache hit ratio.
๐Ÿง Alert on symptoms, diagnose with causes
"Checkout errors are above 2%" is a symptom the business cares about. "Database CPU is 85%" is only a possible cause. Page on the first, and keep the second on a dashboard.

03Real-Life Example

๐ŸตThe Smoke Alarm in Your Home
A good smoke alarm is quiet most of the time. It rings loudly when there is real smoke, and you know what to do. A bad one rings every time you make toast. After a few weeks you take out its battery. Then, on the day of a real fire, it is silent. Alerting works the same way. If it cries wolf, people turn it off or ignore it.
Smoke alarm
Alerting
Detects smoke
A rule on a metric (error rate, latency)
Loud siren for real fire
A page to the on-call person
Low-battery chirp
A ticket for something non-urgent
Rings when you make toast
A false alarm (noisy alert)
You remove the battery
Alert fatigue: alerts get muted or ignored
Fire plan on the fridge
A runbook linked from the alert
Monthly test button
Testing alerts and on-call drills
A page that helps
๐ŸšจAlertcheckout errors 6% for 5 min
โ†’โ†“links to
๐Ÿ“ŠDashboardwhich region, which version
โ†’โ†“and
๐Ÿ“–Runbookstep-by-step actions

04Why Do We Need It?

โฑ๏ธShorter downtime
The sooner a human knows, the sooner it is fixed. Time to detect is part of every outage.
๐Ÿ™‹You hear it first
Better a page than a customer tweet.
๐Ÿ˜ดProtect people
Fewer, better alerts mean fewer sleepless nights and less burnout.
๐ŸŽฏKeep promises
SLOs (for example 99.9% availability) are only real if you are alerted when you are about to miss them.
๐ŸงญFocus
A small set of trusted alerts shows what matters to the business.
๐Ÿ“šLearn over time
Every page is a chance to fix the cause, or to delete or tune a bad alert.
An alert is a request for a human's attention. Spend it only on things that deserve it.

05Where Do We Use It?

๐ŸŒUser-facing services
Error rate, latency and availability of the endpoints users call.
๐Ÿ“ฌPipelines and queues
Age of the oldest message, growing backlog, failed jobs.
๐Ÿ—„๏ธData stores
Replication lag, disk nearly full, failing backups.
๐Ÿ”Security signals
Many failed logins, unusual access, expiring certificates.
๐Ÿ’ผBusiness metrics
Orders per minute drop to zero. Servers may look fine while sales are broken.
๐ŸงชSynthetic checks
A robot that logs in and buys something every minute, from outside, to test the whole path.

06Types / Parts / How It Works

Kinds of alert rules

RuleExampleGood forWeak at
Static thresholdError rate above 5% for 5 minutesSimple, clear failuresNeeds tuning, and misses slow burns
Rate of change / anomalyTraffic is 50% lower than last week at this hourTraffic drops, unusual patternsFalse alarms on holidays and launches
Absence (dead man's switch)No data from a service for 5 minutesSilent crashes and broken collectionNeeds a reliable heartbeat signal
SLO burn rateBudget is being used 14 times too fastPaging only when a promise is at riskNeeds an SLO and some maths
Synthetic checkThe login-and-pay test failed twice in a rowEnd-to-end user viewTests only the paths you scripted

SLOs, error budgets and burn rate

An SLO (service level objective) is a target, for example 99.9% of requests succeed over 30 days. The rest, 0.1%, is the error budget: how much failure you can afford. The burn rate says how fast you are spending it. A burn rate of 1 uses the budget in exactly the period. A burn rate of 14 uses it up in about two days.

Multi-window burn-rate alert
Long window (e.g. 1 hour)
๐Ÿ“Burning fast enough?budget at risk
Short window (e.g. 5 minutes)
โšกStill burning now?not already over
Both true
๐Ÿ“ŸPage
Real problem? Happening now? Wake a human
Check a long window (is it real?) and a short window (is it still happening?). Page only when both agree.

Severity levels (an example scheme)

LevelMeaningResponse
CriticalUsers are badly affected nowPage immediately, any time
WarningLikely to become critical, or a small impactTicket or chat message, handled in work hours
InfoGood to knowDashboard or log only
VisualizerWhich alert rule pages the right person?Pick a scenario and an alert rule. Try the short blip, the slow leak and the big outage with each rule, and check pages against the error budget used.
What happens in this hour?

30 minutes at 30% errors. Many users are hurt.

Alert rule
Error rate per minute (one bar per minute). Red = the alert is firing, cyan = quiet.
minute 03059
Peak error rate: 30.0%
First alert
min 15
Pages
1
separate alerts
Budget used
20.8%
of 30 days
Burn rate
150.1x
last 30 min
A page for a real problem: 20.8% of the monthly budget was used. The first alert came at minute 15.

Model: a 99.9% SLO over 30 days gives an error budget of 43.2 full-outage minutes. A burn rate of 1x uses the budget in exactly 30 days. The burn-rate rule fires only when the last 5 minutes and the last 30 minutes both burn faster than the threshold. A real setup often uses a 1 hour window, so this demo is scaled down. The error rates are a fixed script, not real data.

07How to Use It / Steps / Implementation

Building alerts people trust

  1. 1
    Define what users care about
    Pick a few SLIs: availability, latency and freshness of the key journeys. Set SLOs for them.
  2. 2
    Alert on symptoms
    Page on user-visible problems. Use cause metrics (CPU, queue length) on dashboards to diagnose.
  3. 3
    Add a duration
    Require the condition to hold for a few minutes, so a single blip does not wake anyone.
  4. 4
    Use burn rates for SLOs
    Use a fast burn (page) and a slow burn (ticket), each with a long and a short window.
  5. 5
    Make every page actionable
    Each alert says what is wrong, how bad, who is affected, and links to a dashboard and a runbook.
  6. 6
    Group and route
    Group related alerts into one notification. Send each team only its own. Silence alerts during planned work.
  7. 7
    Review often
    After each incident and every month, delete or tune alerts that were noisy, and add ones you wish you had.
๐Ÿ’กA test for any new alert
Ask four questions. Is it urgent? Is it real (a user is affected)? Can a human do something right now? Would I be happy to be woken for it? If any answer is no, make it a ticket or a dashboard panel.
โš ๏ธWatch the watchers
If the monitoring system itself goes down, you get silence, not alerts. Add an external check and a heartbeat alert that fires when data stops arriving.

08Key Terms to Know

TermMeaning in easy words
MonitoringContinuously collecting and showing data about how a system behaves
AlertA message sent to a human (or system) when a rule says something needs attention
ThresholdThe limit in a rule, such as error rate above 5%
On-callThe person who is responsible for answering pages during a period
Alert fatiguePeople ignore alerts because there are too many unhelpful ones
SLIService level indicator: a measured number, such as the share of successful requests
SLOService level objective: the target you set for an SLI, such as 99.9%
Error budgetThe amount of failure the SLO allows, for example 0.1% of requests
Burn rateHow fast the error budget is being spent compared with the planned pace
RunbookA step-by-step guide linked from an alert for how to check and fix it
False positive / negativeAn alert with no real problem, or a real problem with no alert

09Pros, Cons and Trade-offs

โœ… Pros
  • Problems are found and fixed sooner
  • Protects promises to users (SLOs)
  • Burn-rate alerts page only when it matters
  • A shared view of health across teams
  • Every incident teaches you to improve the rules
โš ๏ธ Cons
  • Hard to tune: too sensitive is noisy, too relaxed misses things
  • Alert fatigue wears people out
  • Static thresholds go stale as traffic changes
  • Needs good data underneath
  • On-call duty has a human cost

Trade-offs

ChoiceWe gainWe lose
Low threshold, short durationVery fast detectionMore false alarms and tired people
High threshold, long durationFew false alarmsSlower detection, small incidents go unseen
Alert on causes (CPU, memory)Early hintsMany alerts with no user impact
Alert on symptoms (errors, latency)Every page matters to usersYou find out only after users are affected
Static thresholdsEasy to explainNeeds constant tuning
Burn-rate alertsPage only when the SLO is at riskMore set-up and a harder explanation

10Common Problems and Mistakes

Common mistakes

  1. Alerting on everything. Hundreds of alerts, and the important one gets lost.
  2. Paging on causes. A CPU spike that no user notices wakes someone up.
  3. No duration. One bad data point fires the alert and then it clears.
  4. No runbook or context. "Something is wrong" at 3 a.m. with no link to what to check.
  5. Alerts nobody owns. They go to a shared channel and everybody assumes someone else handles them.
  6. Never reviewing alerts. Old rules for removed services still fire.
  7. No alert on silence. A broken collector looks exactly like a healthy, quiet system.

Things to watch

๐Ÿ””Alert storms
One outage can trigger hundreds of alerts. Group and dedupe, and set up dependencies between alerts.
๐Ÿ˜ตPager fatigue
Track pages per shift. Many pages per night is a sign to fix the system or the alerts.
๐Ÿ•ณ๏ธBlind spots
Check what is not covered: new services, batch jobs, third-party dependencies.
๐Ÿ—“๏ธSeasonality
Traffic at 3 a.m. is not traffic at noon. Use rules that fit the pattern.

11Real-World Examples

๐Ÿ“˜Google SRE practice
The SRE books describe SLOs, error budgets and burn-rate alerting, and many teams copy the approach.
๐Ÿ”ฅPrometheus Alertmanager
Groups, dedupes, silences and routes alerts from Prometheus rules to chat, email or paging tools.
๐Ÿ“ŸPaging tools
PagerDuty, Opsgenie and similar tools manage on-call schedules, escalation and acknowledgement.
โ˜๏ธCloud alarms
CloudWatch alarms, Google Cloud alerting policies and Azure Monitor alerts react to their own services' metrics.
๐ŸงชSynthetic monitoring
Scripted checks from outside the network test login and purchase flows every minute.
๐Ÿ”Blameless reviews
After incidents, teams review which alert fired late or too often, and fix the rules.
๐Ÿ“Note
Numbers such as the 14.4x burn rate in popular examples depend on your SLO window and policy. Treat them as starting points, not as rules.
Mini case: one alert, three reactions
๐ŸšจErrors above 2% for 5 min
โ†’โ†“pager
๐Ÿ‘ฉโ€๐Ÿ’ปOn-call acknowledgesopens the runbook
โ†’โ†“rollback
โœ…Recoveredthen a review

12Related Topics to Read Next

Metrics and Instrumentationโ†’

Alerts are rules over metrics.

Dashboards and Runbooksโ†’

Every page should link to a dashboard and a runbook.

Three Pillars of Observabilityโ†’

The data that monitoring is built on.

Availabilityโ†’

The number most SLOs are written about.

Heartbeatsโ†’

The same idea as a 'dead man's switch' alert.

Canary Releasesโ†’

Alerts on a canary can stop a bad release early.

13Interview Questions with Short Answers

14Quick Revision Cheat-Sheet

  • โœ”Alert: a rule on data that asks a human for attention.
  • โœ”Good alert: urgent, real, actionable. Else it is a ticket or a dashboard.
  • โœ”Alert on: symptoms (errors, latency). Diagnose with causes (CPU, queues).
  • โœ”Add: a duration, a clear message, a dashboard link and a runbook link.
  • โœ”SLO: target. Error budget: allowed failure. Burn rate: how fast it is used.
  • โœ”Burn-rate alert: long window and short window must both be true.
  • โœ”Fatigue: too many alerts means people ignore the real one. Review and prune.
  • โœ”One line: โ€œWake a human only for what users feel and a human can fix.โ€
โ† Previous
Distributed Tracing
Next โ†’
Dashboards and Runbooks