@Immutable public final class SpanContext extends Object
Span
s and across process boundaries. It contains the identifiers (a trace_id
and span_id
) associated with the Span
and a set of options
.Modifier and Type | Field and Description |
---|---|
static SpanContext |
INVALID
The invalid
SpanContext . |
Modifier and Type | Method and Description |
---|---|
static SpanContext |
create(TraceId traceId,
SpanId spanId,
TraceOptions traceOptions)
Creates a new
SpanContext with the given identifiers and options. |
boolean |
equals(Object obj) |
SpanId |
getSpanId()
Returns the span identifier associated with this
SpanContext . |
TraceId |
getTraceId()
Returns the trace identifier associated with this
SpanContext . |
TraceOptions |
getTraceOptions()
Returns the trace options associated with this
SpanContext . |
int |
hashCode() |
boolean |
isValid()
Returns true if this
SpanContext is valid. |
String |
toString() |
public static final SpanContext INVALID
SpanContext
.public static SpanContext create(TraceId traceId, SpanId spanId, TraceOptions traceOptions)
SpanContext
with the given identifiers and options.traceId
- the trace identifier of the span context.spanId
- the span identifier of the span context.traceOptions
- the trace options for the span context.SpanContext
with the given identifiers and options.public TraceId getTraceId()
SpanContext
.SpanContext
.public SpanId getSpanId()
SpanContext
.SpanContext
.public TraceOptions getTraceOptions()
SpanContext
.SpanContext
.public boolean isValid()
SpanContext
is valid.SpanContext
is valid.