Top Description Fields Methods
io.micrometer.tracing

public Interface BaggageManager

Known Direct Subinterfaces
io.micrometer.tracing.Tracer
Imports
io.micrometer.common.lang.Nullable, java.util.Collections, .Map

Manages Baggage entries. Upon retrieval / creation of a baggage entry puts it in scope. Scope must be closed.
Authors
OpenTelemetry Authors, Marcin Grzejszczak
Since
1.0.0

Field Summary

Modifier and TypeField and Description
public static final BaggageManager
NOOP

A noop implementation.

Method Summary

Modifier and TypeMethod and Description
public Baggage

Returns:

new or already created baggage
createBaggage
(String
baggage name
name
)

Creates a new Baggage entry for the given name or returns an existing one if it's already present.
public Baggage

Returns:

new or already created baggage
createBaggage
(String
baggage name
name
,
String
baggage value
value
)

Creates a new Baggage entry for the given name or returns an existing one if it's already present.
public default BaggageInScope

Returns:

baggage with value
createBaggageInScope
(String
baggage name
name
,
String
baggage value
value
)

Creates a new Baggage entry, sets a value on it and puts it in scope.

public default BaggageInScope

Returns:

baggage with value
createBaggageInScope
(TraceContext
trace context with baggage attached to it
traceContext
,
String
baggage name
name
,
String
baggage value
value
)

Creates a new Baggage entry, sets a value on it and puts it in scope.

public Map<String, String>

Returns:

mapping of all baggage entries from the given scope
getAllBaggage
()

public default Map<String, String>

Returns:

mapping of all baggage entries from the given scope
getAllBaggage
(TraceContext
trace context with baggage. If null will try to get all baggage from current available context
traceContext
)

public Baggage

Returns:

baggage if present or creates a new one if missing with null value
getBaggage
(String
baggage name
name
)

Retrieves Baggage for the given name.

public Baggage

Returns:

baggage or null if not present on the TraceContext
getBaggage
(TraceContext
trace context with baggage attached to it
traceContext
,
String
baggage name
name
)

Retrieves Baggage for the given name.

Field Detail

NOOPback to summary
public static final BaggageManager NOOP

A noop implementation.

Method Detail

createBaggageback to summary
public Baggage createBaggage(String name)

Creates a new Baggage entry for the given name or returns an existing one if it's already present.

Parameters
name:String

baggage name

Returns:Baggage

new or already created baggage

Annotations
@Deprecated
createBaggageback to summary
public Baggage createBaggage(String name, String value)

Creates a new Baggage entry for the given name or returns an existing one if it's already present.

Parameters
name:String

baggage name

value:String

baggage value

Returns:Baggage

new or already created baggage

Annotations
@Deprecated
createBaggageInScopeback to summary
public default BaggageInScope createBaggageInScope(String name, String value)

Creates a new Baggage entry, sets a value on it and puts it in scope.

Parameters
name:String

baggage name

value:String

baggage value

Returns:BaggageInScope

baggage with value

createBaggageInScopeback to summary
public default BaggageInScope createBaggageInScope(TraceContext traceContext, String name, String value)

Creates a new Baggage entry, sets a value on it and puts it in scope.

Parameters
traceContext:TraceContext

trace context with baggage attached to it

name:String

baggage name

value:String

baggage value

Returns:BaggageInScope

baggage with value

getAllBaggageback to summary
public Map<String, String> getAllBaggage()
Returns:Map<String, String>

mapping of all baggage entries from the given scope

getAllBaggageback to summary
public default Map<String, String> getAllBaggage(TraceContext traceContext)
Parameters
traceContext:TraceContext

trace context with baggage. If null will try to get all baggage from current available context

Returns:Map<String, String>

mapping of all baggage entries from the given scope

getBaggageback to summary
public Baggage getBaggage(String name)

Retrieves Baggage for the given name.

Parameters
name:String

baggage name

Returns:Baggage

baggage if present or creates a new one if missing with null value

getBaggageback to summary
public Baggage getBaggage(TraceContext traceContext, String name)

Retrieves Baggage for the given name.

Parameters
traceContext:TraceContext

trace context with baggage attached to it

name:String

baggage name

Returns:Baggage

baggage or null if not present on the TraceContext

Annotations
@Nullable