Metrics, logs & traces
Prometheus + Grafana, structured logging, OpenTelemetry. RED/USE methods for what to measure first.
The mental model
A hospital monitors a patient three ways. The bedside monitor shows heart rate, blood pressure and oxygen as continuous numbers — cheap, always on, good for spotting that something changed. The chart notes record discrete events: "10:42, administered 5mg, patient responded." And when something is genuinely wrong, they run a scan that follows one specific thing through the whole body.
Those are your three signals:
- Metrics — numeric time series, aggregated, cheap, retained for a year. They tell you something is wrong and let you alert on it. Cost is roughly constant regardless of traffic.
- Logs — discrete events with detail. They tell you what exactly happened in one instance. Cost scales with traffic and verbosity.
- Traces — one request's journey across every service, with timing per hop. They tell you where the time or the error came from. Cost scales with traffic, controlled by sampling.
The workflow they're designed for: an alert fires on a metric (error rate above budget), you open a trace to find which hop broke, then read the logs for that specific trace ID to see the actual exception. Metrics narrow, traces localise, logs explain.
The distinction interviewers probe: monitoring vs observability. Monitoring answers questions you thought of in advance ("is CPU above 80%?"). Observability is the property that lets you answer questions you didn't think of, without shipping new code — which in practice means high-cardinality, high-dimensional data: not just "error rate," but error rate sliceable by customer, region, API version and build SHA. If every new question requires a deploy, you have monitoring.
- Deep dive
- Internal architecture
- Real-world use cases
- Best practices
- Common mistakes
- Performance
- Security
- Production troubleshooting
- Advantages & disadvantages
- Alternatives
- Interview expectations
- Interview questions
- Facts to remember
- Cheat sheet
- Quick revision