Scaling and running in production · mid
Observability: logs, metrics and traces
Observability means you can explain what your system is doing from the outside: structured logs say what happened, metrics show rates, errors and latency percentiles over time, and distributed traces show where one request spent its time across services.
Explain it out loud
Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.
Practise by voiceThe notes
What you must know
- Logs: structured JSON events with a request/trace id. Metrics: numbers over time (requests per second, error rate, p50/p95/p99 latency, event loop lag, memory). Traces: a tree of spans for one request across services.
- RED for services: Rate, Errors, Duration. USE for resources: Utilisation, Saturation, Errors.
- Use percentiles, not averages: an average of 200 ms can hide 5% of users waiting 3 s (p95).
- OpenTelemetry is the standard for instrumenting traces, metrics and logs; context travels between services in the W3C traceparent header. Backends: Grafana stack, Datadog, New Relic, CloudWatch/X-Ray (AWS now recommends OpenTelemetry instrumentation).
- SLOs and alerts: alert on user-facing symptoms (error rate, p99 latency against an SLO), not on every CPU blip; every alert needs a runbook.
- Frontend side: RUM and error tracking (Sentry) linked to backend traces with the same trace id.
The red pen
Common traps: mistake → fix
Mistake: Average latency is a good health signal
Fix: averages hide the slow tail; watch p95/p99.
Mistake: More logs = more observability
Fix: without structure, ids and metrics you cannot answer 'why is it slow?'.
Easy to hard
Questions interviewers ask, easy to hard
- How do you know your API is healthy in production?
- Logs vs metrics vs traces: what does each answer?
- Why p99 instead of average?
- A request is slow only sometimes. How do you find which service is responsible?
Explain it out loud
Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.
Practise by voiceYour first interview is free
Sign up and start with a 15-minute interview with the full report, and an English conversation. No card needed.