Everything is slow and nobody knows why: what do you measure?
FotoFlow's feed page has crept up to 2.4 seconds and nobody knows why. Every server's CPU is fine, the database is fine, and the team is trading guesses in chat: maybe the cache, maybe the network, maybe last week's deploy. Metrics tell you something is wrong, traces show where, logs explain why. Without all three you are debugging by superstition.
Numbers over time, and the right ones
Each service already emits metrics: request rate, error share, and latency percentiles, the RED method. Dashboards make the picture clear in one glance: photos and the database are fast, the slowness lives on one path.
Two habits matter here. Watch p99, not averages: one user in a hundred waiting 2 seconds disappears in an average. And alert on what users feel, not on raw CPU. Pick a service level objective, like 99% of feed loads under 1 second, and page someone only when you are burning that budget too fast. A CPU alert fires constantly and means nothing; an SLO alert means users are hurting.
One request, one story
Metrics are aggregates. Logs are the story: timestamped events per service. At thousands of requests a second, lines from different requests interleave into noise, so the fix is a request id handed out at the gateway and printed in every log line. Filter by one id and you read one request's story, end to end. Log structured JSON, not free text, so you can filter by request, user, or service.
The trace completes the picture. Every hop of one request becomes a span with the same trace id, and the waterfall shows exactly where time goes. FotoFlow's trace is unambiguous: 2.1 of the 2.4 seconds are spent waiting on the third-party EXIF-scan API. Fix: a 300 millisecond timeout, cache recent scan results, and p99 drops to 310 milliseconds. OpenTelemetry collects spans from every language, and Jaeger or Tempo explores them.
The 3 a.m. version
Errors spike at 03:12 and the pager fires. The dashboard has deploy and config-change markers, and the marker at 03:10 answers the first question of almost every incident: what changed? Mitigate first, roll the change back, restore service, and investigate the root cause after. Not the other way around.
Afterwards the team writes a post-mortem: timeline, impact, root cause, and the action that stops it happening again, here config changes go through the same canary rollout as code. It is blameless on purpose: the question is how the system let a mistake through, not who made it. Each incident is expensive training data.
What this does not solve
Observability tells you what is happening, but it cannot tell you about demand that has not arrived yet. It also decays: log volume costs money, dashboards rot when services change, and alerts need pruning or the pager gets ignored. The discipline is a scheduled review of what you measure, not a one-time setup. Instrument before you need it. The outage is the wrong time to add logging.
Your feed takes 2.4 seconds. Which of the three signals would tell you the cause today, and which are you missing?
Your CPU alert fired 40 times last month and meant nothing twice. What would you page on instead?
The slow part is found. Next in the series: Twelve engineers, one codebase: is it time to split the app?
Sources
OpenTelemetry
Google SRE Book
System Design Primer
Recommended for you
- Craft & Skills
One server, 10 million users: how does a photo app survive that?
A 40-post series that follows FotoFlow, a photo app, from one server and 100 users to 10 million users with direct messages. One problem, one fix, one honest cost at a time.
- Craft & Skills
Ten million users want direct messages: could you design the chat system?
The final design: 20 million open sockets and a promise that every message arrives, in order, exactly once. Dumb gateways, a connection registry, store-first durability and sync by cursor.
- Craft & Skills
Five million home feeds: how do you build the page everyone opens?
The home feed must load in 200 ms from two hundred followed accounts. Fan-out on read melts at 4.6 million lookups a second; fan-out on write melts on celebrities; the hybrid survives both.
- Craft & Skills
FotoFlow wants short share links: could you design one today?
The first full design walkthrough: turn a one-line brief into numbers, the simplest system, then fix codes, caching, storage and abuse one bottleneck at a time. The method is the point.
Enjoyed this article?
Subscribe for new articles. No spam. Unsubscribe anytime.
Typed live, never pasted.