Span events vs span links vs logs: when do you use each?

IntermediateConceptTracing & OpenTelemetry
Answer
  • Span event: a timestamped point inside one span, e.g. exception with exception.type and exception.stacktrace, or "cache miss". Use it for things that only make sense in the context of that operation.
  • Span link: a reference from one span to another span, often in a different trace. Use it for batch consumers processing 100 messages from 100 different producers, or a job triggered by an earlier request. Parent/child cannot express many-to-one; links can.
  • Log record: a standalone event with its own lifecycle, retention and search. With OTel logs, records carry trace_id and span_id, so they correlate anyway.

Rule of thumb: high-volume diagnostic output goes to logs; small, operation-specific facts go into span events.

All Monitoring & Observability questions Roadmap: Logging & tracing

More on Tracing & OpenTelemetry