Class SpanContext
java.lang.Object
io.opencensus.trace.SpanContext
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final SpanContextThe invalidSpanContext.private final SpanIdprivate final TraceIdprivate final TraceOptionsprivate final Tracestateprivate static final Tracestate -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateSpanContext(TraceId traceId, SpanId spanId, TraceOptions traceOptions, Tracestate tracestate) -
Method Summary
Modifier and TypeMethodDescriptionstatic SpanContextcreate(TraceId traceId, SpanId spanId, TraceOptions traceOptions) Deprecated.static SpanContextcreate(TraceId traceId, SpanId spanId, TraceOptions traceOptions, Tracestate tracestate) Creates a newSpanContextwith the given identifiers and options.booleanReturns the span identifier associated with thisSpanContext.Returns the trace identifier associated with thisSpanContext.Returns theTraceOptionsassociated with thisSpanContext.Returns theTracestateassociated with thisSpanContext.inthashCode()booleanisValid()Returns true if thisSpanContextis valid.toString()
-
Field Details
-
TRACESTATE_DEFAULT
-
traceId
-
spanId
-
traceOptions
-
tracestate
-
INVALID
-
-
Constructor Details
-
SpanContext
private SpanContext(TraceId traceId, SpanId spanId, TraceOptions traceOptions, Tracestate tracestate)
-
-
Method Details
-
create
@Deprecated public static SpanContext create(TraceId traceId, SpanId spanId, TraceOptions traceOptions) Deprecated.Creates a newSpanContextwith the given identifiers and options.- Parameters:
traceId- the trace identifier of the span context.spanId- the span identifier of the span context.traceOptions- the trace options for the span context.- Returns:
- a new
SpanContextwith the given identifiers and options.
-
create
public static SpanContext create(TraceId traceId, SpanId spanId, TraceOptions traceOptions, Tracestate tracestate) Creates a newSpanContextwith the given identifiers and options.- Parameters:
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.- Returns:
- a new
SpanContextwith the given identifiers and options. - Since:
- 0.16
-
getTraceId
Returns the trace identifier associated with thisSpanContext.- Returns:
- the trace identifier associated with this
SpanContext. - Since:
- 0.5
-
getSpanId
Returns the span identifier associated with thisSpanContext.- Returns:
- the span identifier associated with this
SpanContext. - Since:
- 0.5
-
getTraceOptions
Returns theTraceOptionsassociated with thisSpanContext.- Returns:
- the
TraceOptionsassociated with thisSpanContext. - Since:
- 0.5
-
getTracestate
Returns theTracestateassociated with thisSpanContext.- Returns:
- the
Tracestateassociated with thisSpanContext. - Since:
- 0.5
-
isValid
public boolean isValid()Returns true if thisSpanContextis valid.- Returns:
- true if this
SpanContextis valid. - Since:
- 0.5
-
equals
-
hashCode
-
toString
-
create(TraceId, SpanId, TraceOptions, Tracestate).