Top Description Fields Constructors Methods
io.opentelemetry.api.internal

public abstract Class ImmutableSpanContext

extends Object
implements SpanContext
Class Inheritance
All Implemented Interfaces
io.opentelemetry.api.trace.SpanContext
Annotations
@Immutable
@AutoValue
Imports
com.google.auto.value.AutoValue, io.opentelemetry.api.trace.SpanContext, .SpanId, .TraceFlags, .TraceId, .TraceState, javax.annotation.concurrent.Immutable

This class is internal and is hence not for public use. Its APIs are unstable and can change at any time.

Field Summary

Modifier and TypeField and Description
public static final SpanContext

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static SpanContext

Returns:

a new SpanContext with the given identifiers and options.
create
(String
the trace identifier of the SpanContext.
traceIdHex
,
String
the span identifier of the SpanContext.
spanIdHex
,
TraceFlags
the trace flags of the SpanContext.
traceFlags
,
TraceState
the trace state for the SpanContext.
traceState
,
boolean
the remote flag for the SpanContext.
remote
,
boolean
pass true to skip validation of trace ID and span ID as an optimization in cases where they are known to have been already validated.
skipIdValidation
)

Creates a new SpanContext with the given identifiers and options.

public abstract boolean
isValid()

Redeclares as abstract: io.opentelemetry.api.trace.SpanContext.isValid.

Returns true if this SpanContext is valid.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

INVALIDback to summary
public static final SpanContext INVALID

Constructor Detail

ImmutableSpanContextback to summary
public ImmutableSpanContext()

Method Detail

createback to summary
public static SpanContext create(String traceIdHex, String spanIdHex, TraceFlags traceFlags, TraceState traceState, boolean remote, boolean skipIdValidation)

Creates a new SpanContext with the given identifiers and options.

If the traceId or the spanId are invalid (ie. do not conform to the requirements for hexadecimal ids of the appropriate lengths), both will be replaced with the standard "invalid" versions (i.e. all '0's). See SpanId#isValid(CharSequence) and TraceId#isValid(CharSequence) for details.

Parameters
traceIdHex:String

the trace identifier of the SpanContext.

spanIdHex:String

the span identifier of the SpanContext.

traceFlags:TraceFlags

the trace flags of the SpanContext.

traceState:TraceState

the trace state for the SpanContext.

remote:boolean

the remote flag for the SpanContext.

skipIdValidation:boolean

pass true to skip validation of trace ID and span ID as an optimization in cases where they are known to have been already validated.

Returns:SpanContext

a new SpanContext with the given identifiers and options.

isValidback to summary
public abstract boolean isValid()

Redeclares as abstract: io.opentelemetry.api.trace.SpanContext.isValid.

Doc from io.opentelemetry.api.trace.SpanContext.isValid.

Returns true if this SpanContext is valid.

Returns:boolean

true if this SpanContext is valid.

Annotations
@Override