Java Observability

In one process a stack trace is enough. Across twenty, you need to be able to follow one request and to know what normal looks like.

3 concepts · 9 interview questions

What this topic covers

Every concept in observability, and the questions each one gets asked as. Where a question links, it has a full write-up.

Distributed tracing

A trace id created at the edge and propagated on every hop lets one request be reconstructed across services, with timing per span.

  • How do you follow one request across ten services?
  • What is the difference between a trace, a span and a correlation id?
  • Why is sampling necessary, and what does it lose?

Logging that is useful at scale

Logs stop being readable once there are thousands per second. Structure, levels and context fields are what make them queryable rather than merely voluminous.

  • What makes a log line useful in production?
  • What should never appear in a log?
  • How do you decide between INFO, WARN and ERROR?

Metrics, health and alerting

Metrics tell you the shape of behaviour over time; health checks tell an orchestrator whether to send traffic. Confusing the two causes restarts under load.

  • Why do you alert on percentiles rather than averages?
  • What is the difference between a liveness and a readiness probe?
  • What are the four golden signals?

More in Microservices and APIs

See the whole reference map →