SpanContext

zio.blocks.telemetry.SpanContext
See theSpanContext companion object
final case class SpanContext(traceIdHi: Long, traceIdLo: Long, spanId: SpanId, traceFlags: TraceFlags, traceState: String, isRemote: Boolean)

Represents an OpenTelemetry SpanContext - the propagatable part of a span.

The trace ID is inlined as two Long fields (traceIdHi, traceIdLo) for zero heap allocation. SpanId and TraceFlags are AnyVal types, also zero-alloc.

Value parameters

isRemote

whether this context originates from a remote parent

spanId

the span identifier

traceFlags

the trace flags (sampled flag, etc.)

traceIdHi

the high 64 bits of the trace identifier

traceIdLo

the low 64 bits of the trace identifier

traceState

the trace state string (vendor-specific tracing headers)

Attributes

Companion
object
Source
SpanContext.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def isSampled: Boolean

Checks if this span context is sampled.

Checks if this span context is sampled.

Returns true if the sampled flag in traceFlags is set.

Attributes

Source
SpanContext.scala
def isValid: Boolean

Checks if this span context is valid.

Checks if this span context is valid.

A span context is valid if both its trace ID and span ID are valid.

Attributes

Source
SpanContext.scala
def traceIdHex: String

Returns the trace ID as a 32-character lowercase hex string.

Returns the trace ID as a 32-character lowercase hex string.

Attributes

Source
SpanContext.scala

Inherited methods

def productElementNames: Iterator[String]

An iterator over the names of all the elements of this product.

An iterator over the names of all the elements of this product.

Attributes

Inherited from:
Product
Source
Product.scala
def productIterator: Iterator[Any]

An iterator over all the elements of this product.

An iterator over all the elements of this product.

Attributes

Returns

in the default implementation, an Iterator[Any]

Inherited from:
Product
Source
Product.scala