← Study paths

Knowing what broke

Observability from the first alert to the exact slow span.

6 blocks · about 33 min of reading · ends with Notification System

When you finish, you should be able to say

Describe how you would find a slow request across ten services, starting from a page.

The route

6 blocks (3 fundamental, 3 senior), then the practice problem.

  1. Measure what users feelFundamental
  2. Set SLOs and spend the error budgetSenior
  3. Log so you can queryFundamental
  4. Tag every log line with the requestFundamental
  5. Follow one request across servicesSenior
  6. Deploy without downtimeSenior
  7. Notification System
Observability & operationsFundamentalSenior
Read each block, then tick “I can explain this”: the path remembers where you are.Start with step 1
Your Notification System so far0 of 6 blocks in
Metrics storeAmazon CloudWatchrate, errors, p99,queue depthSLO burn-rate alertsAmazon CloudWatchp99 submit to hand-offunder 5 sOn-call engineerpaged on the symptom,not the causeProducer servicesAmazon EC2 Auto Scalingsend a trace id withthe requestNotification APIAmazon EC2 Auto Scalingmints request id,returns itRouter workersAmazon EC2 Auto Scalingrestore ids frommessage headersSMS sender fleetAmazon EC2 Auto Scalingstable build on mosttrafficLog storeAmazon CloudWatchJSON lines, query byrequest_idTrace collectorAWS X-Raykeeps slow and failedtracesCanary sender buildsmall slice, comparedwith baselineStep 1: Measure what users feel1Step 2: Set SLOs and spend the error budget2Step 4: Tag every log line with the request4Step 4: Tag every log line with the request4Step 3: Log so you can query3Step 5: Follow one request across services5Step 6: Deploy without downtime6POST + trace idintake queuechannel queuecounters, histogramserror ratiopagelog linesspansweighted slice

Next, step 1 adds Metrics store (outlined). A box fills in when you tick “I can explain this” on the block that introduces it; plain boxes come from the problem itself.

Each block has a diagram. Open one beside its step, or all of them at once.
  1. Measure what users feel

    Observability & operationsfundamental~6 min

    What to measure, and why you alert on symptoms rather than causes.

    You learn about outages from users.

    Say it like this: I want to know about an outage before users do, so every service emits rate, errors, latency histograms and saturation, and the pager fires on the user-facing symptom rather than on every internal cause.

    Adds to the design: Metrics store

    Check yourself: Which signals would you alert on for the redirect service of a URL shortener?

    Error ratio of redirects over 5 minutes, p99 redirect latency against the 50 ms target, and cache hit ratio dropping below a floor, because a falling hit ratio predicts database overload before latency moves. Saturation on the Redis connection pool would be a ticket, not a page.

    Read this block →

  2. Set SLOs and spend the error budget

    Observability & operationssenior~6 min

    Turning a metric into a promise, and knowing when to stop shipping.

    Teams argue about whether the system is reliable enough and whether to ship or stabilise.

    Say it like this: I set an SLO for what users feel, say 99.9% of redirects succeed within 300 ms over 30 days, treat the 0.1% as a budget the team can spend on launches, and page on how fast that budget is burning rather than on single blips.

    Adds to the design: SLO burn-rate alerts

    Check yourself: Why alert on burn rate instead of on the error ratio?

    Burn rate normalises the error ratio against the budget and the window, so the same alert expresses "we will run out in two days" regardless of traffic. It also lets you page on fast burns while only ticketing slow ones, which an error-ratio threshold cannot distinguish.

    Read this block →

  3. Log so you can query

    Observability & operationsfundamental~5 min

    Logs you can query instead of grep.

    Grepping free-text logs across 200 servers during an incident.

    Say it like this: During an incident I need to filter logs by request id, user and service across the whole fleet in seconds, so every service writes JSON lines with a fixed set of fields to a central store instead of free text to local disk.

    Adds to the design: Log store

    Check yourself: What fields belong in every log line?

    Timestamp in UTC with milliseconds, level, service, instance or pod, request id, and a short message. Add user id or tenant where the service knows it, and a stable event name so you can count occurrences without parsing the message.

    Read this block →

  4. Tag every log line with the request

    Observability & operationsfundamental~5 min

    The one id that ties every log line of a request together, including across queues.

    Logs from ten services describe one failed request but nothing ties them together.

    Say it like this: One failed notification touches the API, a queue, a router, a sender and a webhook, so I mint a correlation id at the edge and carry it through every header, message envelope and log line until one search returns the whole story.

    Adds to the design: Notification API, Router workers

    Check yourself: How is a correlation id different from a trace id, and do you need both?

    A trace id is for the tracing system and is often only sampled; a correlation id is for logs and support and must exist on every request. They can be the same value as long as it is generated on every request even when the trace is not sampled, which is the setup to prefer.

    Read this block →

  5. Follow one request across services

    Observability & operationssenior~6 min

    The waterfall that shows which hop was slow.

    A slow request touches ten services; which one is slow?

    Say it like this: When a request crosses ten services I need to see where the time went, so every hop records a span under one trace id and I sample enough traces to keep the slow and failed ones.

    Adds to the design: Trace collector

    Check yourself: How does trace context get from one service to the next?

    In a header, traceparent, which carries the trace id, the parent span id and a sampled flag. Every outbound HTTP or gRPC call adds it, every inbound call reads it, and for queues the same fields go into the message headers so the consumer can continue the trace.

    Read this block →

  6. Deploy without downtime

    Observability & operationssenior~5 min

    Finish with how you ship the fix without a second incident.

    A bad deploy hits 100% of users at once.

    Say it like this: A bad build should hurt 1% of traffic for five minutes, not everyone, so I deploy the new version next to the old, shift a small weighted slice to it, compare its error rate and p99 with the old version, and only then widen or roll back.

    Adds to the design: Canary sender build

    Check yourself: Canary or blue-green for a service with 50 requests per second?

    Blue-green. At 50 requests per second a 1% canary sees half a request per second, so a 20-minute hold yields 600 requests, too few to detect a 0.5% error rate. Switching everything to a warmed green environment with instant switch-back gives a clearer signal and a clean rollback.

    Read this block →

  7. Putting it together

    How the blocks above combine into one design for Notification System. The numbers on the boxes are the steps that introduce each part.

    Observability for the notification system, assembled from the path
    Metrics storeAmazon CloudWatchrate, errors, p99,queue depthSLO burn-rate alertsAmazon CloudWatchp99 submit to hand-offunder 5 sOn-call engineerpaged on the symptom,not the causeProducer servicesAmazon EC2 Auto Scalingsend a trace id withthe requestNotification APIAmazon EC2 Auto Scalingmints request id,returns itRouter workersAmazon EC2 Auto Scalingrestore ids frommessage headersSMS sender fleetAmazon EC2 Auto Scalingstable build on mosttrafficLog storeAmazon CloudWatchJSON lines, query byrequest_idTrace collectorAWS X-Raykeeps slow and failedtracesCanary sender buildsmall slice, comparedwith baselineStep 1: Measure what users feel1Step 2: Set SLOs and spend the error budget2Step 4: Tag every log line with the request4Step 4: Tag every log line with the request4Step 3: Log so you can query3Step 5: Follow one request across services5Step 6: Deploy without downtime6POST + trace idintake queuechannel queuecounters, histogramserror ratiopagelog linesspansweighted slice

    Each number is a step of this path; a box with two numbers is shaped by both blocks. The ring colour is the block's category, as on the route map. Boxes without a number come from the problem itself. Point at a step below, or at a bubble, to see where it appears.

    1. Measure what users feel
    2. Set SLOs and spend the error budget
    3. Log so you can query
    4. Tag every log line with the request
    5. Follow one request across services
    6. Deploy without downtime

    Every hop from the API through the router to the senders emits metrics, JSON logs and trace spans under one request id carried in the queue message headers. Alerts fire on the burn rate of the delivery SLO, and new sender builds take a small slice of traffic before they take it all.

    How each block shows up in the design

    • 1. Measure what users feel: every stage emits request rate, error rate, latency histograms and queue depth, and the status topic feeds dashboards of sent, delivered and failed per channel and provider, so a Twilio outage shows up as one red SMS line rather than a vague rise in errors.
    • 2. Set SLOs and spend the error budget: the SLO is the requirement users feel, transactional notifications reaching the provider within 5 s at p99, and the pager fires on how fast that budget is burning instead of on every internal blip; DLQ depth gets its own alert.
    • 3. Log so you can query: the API, router and senders write JSON lines with fixed fields such as request_id, notification_id, channel and provider to a central store, so one query filters six events per notification across the whole fleet.
    • 4. Tag every log line with the request: the API mints a request id and returns it to the caller, and the id travels in the queue message headers through intake, router and sender, so a missing OTP is one search away from its whole story.
    • 5. Follow one request across services: the producer's trace id rides the same message attributes, every hop records a span, and the collector keeps every slow or failed trace plus a sample of the rest, which shows whether time went into a queue, the router or the provider.
    • 6. Deploy without downtime: a new sender build takes a small weighted slice of SMS traffic first, and its error ratio and p99 hand-off time are compared with the old build over the same window before it is widened or rolled back.
  8. ★

    Notification System

    Now run the timed practice. The blocks above should appear in your answer without prompting; if one does not, that is the one to reread.

The same parts on other clouds

The diagrams above name AWS services as one concrete example. Every part has a close equivalent elsewhere. In an interview, name the role first, such as “a managed Redis cache”, then the product you would pick.

AWSUsed here asGoogle CloudMicrosoft AzureOpen source and others
Amazon CloudWatchMetrics store, SLO burn-rate alerts, Log store, Metrics collector, Dashboards, Alert rules, SLI stream, Fast burn 14.4×, Slow burn 6×, Hot store (14 days)Cloud Monitoring, Cloud LoggingAzure MonitorPrometheus and Grafana, Datadog
Amazon EC2 Auto ScalingProducer services, Notification API, Router workers, SMS sender fleet, Service instances, Service pods, SMS sender, Webhook handler, Feed service, Old version ×40, Canary ×1 per regionCompute Engine managed instance groupsVirtual Machine Scale SetsKubernetes Deployment with a HorizontalPodAutoscaler, Nomad
AWS X-RayTrace collector, Waterfall viewCloud TraceApplication InsightsOpenTelemetry with Jaeger or Grafana Tempo
Amazon S3Cold archive (90 days)Cloud StorageBlob StorageCloudflare R2, MinIO, Ceph
Amazon SQSIntake queuePub/Sub, Cloud TasksService Bus queues, Queue StorageRabbitMQ, ActiveMQ
Amazon API GatewayGatewayAPI Gateway, ApigeeAPI ManagementKong, Tyk
Amazon SageMakerRanking serviceVertex AIAzure Machine LearningKServe, Ray Serve, NVIDIA Triton
Amazon ElastiCachePost cacheMemorystoreAzure Managed RedisRedis, Valkey, Memcached
Application Load BalancerLoad balancerCloud Load BalancingApplication Gateway, Azure Load BalancerNGINX, HAProxy, Envoy