Skip to the page

Monitoring and on-call · core

Metrics, logs, traces and the four golden signals

Metrics show that something is wrong, traces show where, and logs show what happened. The four golden signals tell you what to measure on any service. A request can be slow while every service says it is fast.

The notes

What you must know

  • The four golden signals: latency (a histogram, p50, p95, p99, with errors timed separately), traffic, errors (5xx and also wrong answers such as a 200 with an error body), and saturation (how full the service is).
  • Saturation examples: pool usage and wait time, queue length, CPU throttling, memory against the limit, Redis evictions, connections against max_connections.
  • RED (rate, errors, duration) for request services; USE (utilisation, saturation, errors) for resources such as CPU, disks and pools. For a Kafka consumer: lag measured as time, rate, errors, rebalances.
  • Metrics are cheap numbers over time. Logs are detailed events, best as structured JSON. Traces follow one request across services with spans.
  • Context propagation: the W3C traceparent header between services and message headers for Kafka. Put the trace id and span id in every log line; exemplars link a metric spike to example traces.
  • OpenTelemetry (Nov 2026): traces, metrics, baggage and logs are stable in the specification; profiles is still in development. SDK status differs by language: for example logs are stable in Java and .NET but still in development in JavaScript and Python.
  • A service metric counts only time inside the service. Waiting for a pool connection, queues, retries after a client timeout and calls made one after another do not show there. Add spans for waits, batch or parallelise sequential calls, and pass one deadline down the chain.
  • Head sampling is cheap; tail sampling in the Collector keeps every error and slow trace.

The red pen

Common traps: mistake → fix

  • Mistake: Average latency is a good alert signal

    Fix: use percentiles per endpoint; a fast 500 can hide in an average.

  • Mistake: Each service is fast, so the system is fast

    Fix: time between services (waits, retries, sequential calls) is not in any service metric.

  • Mistake: Put the user id in a metric label to see per-user data

    Fix: that creates unlimited series; use logs and traces for ids.

Easy to hard

Questions interviewers ask, easy to hard

  1. What are the four golden signals and how would you apply them to an orders API?
  2. What is the difference between RED and USE?
  3. A request takes 4 seconds, but every service reports under 300 ms. How do you find the time?
  4. How do traces and logs connect?
  5. What do you sample, and how?

Your first interview is free

Sign up and start with a 15-minute interview with the full report, and an English conversation. No card needed.

Start your free interview