@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)
Deprecated.
|
static SpanContext |
create(TraceId traceId,
SpanId spanId,
TraceOptions traceOptions,
Tracestate tracestate)
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
TraceOptions associated with this SpanContext . |
Tracestate |
getTracestate()
Returns the
Tracestate associated with this SpanContext . |
int |
hashCode() |
boolean |
isValid()
Returns true if this
SpanContext is valid. |
String |
toString() |
public static final SpanContext INVALID
SpanContext
.@Deprecated public static SpanContext create(TraceId traceId, SpanId spanId, TraceOptions traceOptions)
create(TraceId, SpanId, TraceOptions, Tracestate)
.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 static SpanContext create(TraceId traceId, SpanId spanId, TraceOptions traceOptions, Tracestate tracestate)
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.tracestate
- the trace state for the span context.SpanContext
with the given identifiers and options.public TraceId getTraceId()
SpanContext
.SpanContext
.public SpanId getSpanId()
SpanContext
.SpanContext
.public TraceOptions getTraceOptions()
TraceOptions
associated with this SpanContext
.TraceOptions
associated with this SpanContext
.public Tracestate getTracestate()
Tracestate
associated with this SpanContext
.Tracestate
associated with this SpanContext
.public boolean isValid()
SpanContext
is valid.SpanContext
is valid.