Spans and Traces
Properties
created
14.04.2026, 17:00
modified
26.07.2026, 13:52
published
Empty
sources
OTel Traces Concepts
topics
Distributed Tracing, Observability
authors
Empty
ai-assisted
Yes
- Core data model of distributed tracing ( OTel Traces Concepts)
# Trace
- Represents the full end-to-end journey of a single request through a distributed system
- Composed of a tree of spans
- Identified by a globally unique traceId (128-bit / 16-byte hex string)
- All spans belonging to the same request share the same
traceId
# Span
- Represents a single unit of work within a trace
- Fields
traceId— which trace this span belongs tospanId— unique ID for this span (64-bit)parentSpanId— ID of the parent span (empty for root span)name— operation name (e.g.GET /api/users,db.query)startTime/endTime— timestampsduration— derived from start/endstatus—OK,ERROR,UNSETkind—SERVER,CLIENT,PRODUCER,CONSUMER,INTERNALattributes— key-value metadata (http.method,db.statement,user.id)events— timestamped log-like messages within a spanlinks— references to spans in other traces (e.g. async jobs)
# Span Relationships
| |
# Span Attributes (Semantic Conventions)
- OTel defines standard attribute names to ensure consistency across languages/backends
- HTTP:
http.method,http.status_code,http.url - DB:
db.system,db.statement,db.name - RPC:
rpc.system,rpc.service,rpc.method - Messaging:
messaging.system,messaging.destination
- HTTP:
# Sampling
- Recording every span in high-traffic systems is expensive
- Head-based sampling — decision made at trace root (fast, simple)
- Always-on, probabilistic (e.g. 10%), rate-limiting
- Tail-based sampling — decision made after full trace collected (can sample based on outcome)
- Keep all error traces, sample 1% of successful traces
- Requires buffering — typically done in the OTel Collector