Knowing what broke
Observability from the first alert to the exact slow span.
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.
- Measure what users feelFundamental
- Set SLOs and spend the error budgetSenior
- Log so you can queryFundamental
- Tag every log line with the requestFundamental
- Follow one request across servicesSenior
- Deploy without downtimeSenior
- Notification System
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.
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.
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.
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.
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.
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?
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.
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 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.
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.
- ★
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.
| AWS | Used here as | Google Cloud | Microsoft Azure | Open source and others |
|---|---|---|---|---|
| Amazon CloudWatch | Metrics 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 Logging | Azure Monitor | Prometheus and Grafana, Datadog |
| Amazon EC2 Auto Scaling | Producer services, Notification API, Router workers, SMS sender fleet, Service instances, Service pods, SMS sender, Webhook handler, Feed service, Old version ×40, Canary ×1 per region | Compute Engine managed instance groups | Virtual Machine Scale Sets | Kubernetes Deployment with a HorizontalPodAutoscaler, Nomad |
| AWS X-Ray | Trace collector, Waterfall view | Cloud Trace | Application Insights | OpenTelemetry with Jaeger or Grafana Tempo |
| Amazon S3 | Cold archive (90 days) | Cloud Storage | Blob Storage | Cloudflare R2, MinIO, Ceph |
| Amazon SQS | Intake queue | Pub/Sub, Cloud Tasks | Service Bus queues, Queue Storage | RabbitMQ, ActiveMQ |
| Amazon API Gateway | Gateway | API Gateway, Apigee | API Management | Kong, Tyk |
| Amazon SageMaker | Ranking service | Vertex AI | Azure Machine Learning | KServe, Ray Serve, NVIDIA Triton |
| Amazon ElastiCache | Post cache | Memorystore | Azure Managed Redis | Redis, Valkey, Memcached |
| Application Load Balancer | Load balancer | Cloud Load Balancing | Application Gateway, Azure Load Balancer | NGINX, HAProxy, Envoy |