Top Description Inners Fields Methods
io.micrometer.tracing

public Interface TraceContext

Imports
io.micrometer.common.lang.Nullable

Contains trace and span data.
Author
Marcin Grzejszczak
Since
1.0.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface

Field Summary

Modifier and TypeField and Description
public static final TraceContext
NOOP

A noop implementation.

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

parent span id or null if one is not set
parentId
()

Parent span id.

public Boolean

Returns:

true when sampled, false when not sampled and null when sampling decision should be deferred
sampled
()

public String

Returns:

span id
spanId
()

Span id.

public String

Returns:

trace id of a span
traceId
()

Trace id.

Field Detail

NOOPback to summary
public static final TraceContext NOOP

A noop implementation.

Method Detail

parentIdback to summary
public String parentId()

Parent span id.

Returns:String

parent span id or null if one is not set

Annotations
@Nullable
sampledback to summary
public Boolean sampled()
Returns:Boolean

true when sampled, false when not sampled and null when sampling decision should be deferred

spanIdback to summary
public String spanId()

Span id.

Returns:String

span id

traceIdback to summary
public String traceId()

Trace id.

Returns:String

trace id of a span

io.micrometer.tracing back to summary

public Interface TraceContext.Builder


Builder for TraceContext.
Since
1.0.0

Field Summary

Modifier and TypeField and Description
public static final TraceContext.Builder
NOOP

A noop implementation.

Method Summary

Modifier and TypeMethod and Description
public TraceContext

Returns:

trace context
build
()

Builds the trace context.

public TraceContext.Builder

Returns:

this
parentId
(String
parent trace id
parentId
)

Sets parent id on the trace context.

public TraceContext.Builder

Returns:

this
sampled
(Boolean
if span is sampled
sampled
)

Sets sampled on the trace context.

public TraceContext.Builder

Returns:

this
spanId
(String
span id
spanId
)

Sets span id on the trace context.

public TraceContext.Builder

Returns:

this
traceId
(String
trace id
traceId
)

Sets trace id on the trace context.

Field Detail

NOOPback to summary
public static final TraceContext.Builder NOOP

A noop implementation.

Method Detail

buildback to summary
public TraceContext build()

Builds the trace context.

Returns:TraceContext

trace context

parentIdback to summary
public TraceContext.Builder parentId(String parentId)

Sets parent id on the trace context.

Parameters
parentId:String

parent trace id

Returns:TraceContext.Builder

this

sampledback to summary
public TraceContext.Builder sampled(Boolean sampled)

Sets sampled on the trace context.

Parameters
sampled:Boolean

if span is sampled

Returns:TraceContext.Builder

this

spanIdback to summary
public TraceContext.Builder spanId(String spanId)

Sets span id on the trace context.

Parameters
spanId:String

span id

Returns:TraceContext.Builder

this

traceIdback to summary
public TraceContext.Builder traceId(String traceId)

Sets trace id on the trace context.

Parameters
traceId:String

trace id

Returns:TraceContext.Builder

this