SpanContext

data class SpanContext(val traceId: String, val spanId: String, val parentSpanId: String? = null, val traceFlags: Byte = SAMPLED, val traceState: String? = null)

Context for a span in a distributed trace.

Follows W3C Trace Context specification for trace/span ID formats.

Since

0.4.0

Constructors

Link copied to clipboard
constructor(traceId: String, spanId: String, parentSpanId: String? = null, traceFlags: Byte = SAMPLED, traceState: String? = null)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Whether this span is sampled (should be recorded and exported).

Link copied to clipboard

Parent span ID if this is a child span, null for root

Link copied to clipboard

16-character lowercase hex span identifier

Link copied to clipboard

Trace flags (e.g., 0x01 for sampled)

Link copied to clipboard

32-character lowercase hex trace identifier

Link copied to clipboard

Optional vendor-specific trace state

Functions

Link copied to clipboard

Format as W3C traceparent header value.