What is the difference between tracing and logging?
⚡
Quick Answer
Logs are discrete, timestamped event records from a single component. A distributed trace follows one request across all the services it touches, showing the path and latency of each span.
Detailed Answer
Logs answer what happened here; traces answer where did the time go across the system and which service caused the latency or error. Traces are composed of spans with a shared trace ID; correlating that ID into your logs links the two. Metrics, logs, and traces together form the observability trio.
💡
Interview Tip
Use span and trace ID and explain that correlating the trace ID into logs ties the pillars together.
tracingloggingobservability