Package org.springframework.cloud.sleuth
Interface BaggageManager
-
- All Known Subinterfaces:
Tracer
public interface BaggageManager
ManagesBaggageInScope
entries. Upon retrieval / creation of a baggage entry puts it in scope. Scope must be closed.- Since:
- 3.0.0
- Author:
- OpenTelemetry Authors, Marcin Grzejszczak
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description BaggageInScope
createBaggage(String name)
Creates a newBaggageInScope
entry for the given name or returns an existing one if it's already present.BaggageInScope
createBaggage(String name, String value)
Creates a newBaggageInScope
entry for the given name or returns an existing one if it's already present.Map<String,String>
getAllBaggage()
BaggageInScope
getBaggage(String name)
RetrievesBaggageInScope
for the given name.BaggageInScope
getBaggage(TraceContext traceContext, String name)
RetrievesBaggageInScope
for the given name.
-
-
-
Method Detail
-
getAllBaggage
Map<String,String> getAllBaggage()
- Returns:
- mapping of all baggage entries from the given scope
-
getBaggage
@Nullable BaggageInScope getBaggage(String name)
RetrievesBaggageInScope
for the given name.- Parameters:
name
- baggage name- Returns:
- baggage or
null
if not present
-
getBaggage
@Nullable BaggageInScope getBaggage(TraceContext traceContext, String name)
RetrievesBaggageInScope
for the given name.- Parameters:
traceContext
- trace context with baggage attached to itname
- baggage name- Returns:
- baggage or
null
if not present
-
createBaggage
BaggageInScope createBaggage(String name)
Creates a newBaggageInScope
entry for the given name or returns an existing one if it's already present.- Parameters:
name
- baggage name- Returns:
- new or already created baggage
-
createBaggage
BaggageInScope createBaggage(String name, String value)
Creates a newBaggageInScope
entry for the given name or returns an existing one if it's already present.- Parameters:
name
- baggage namevalue
- baggage value- Returns:
- new or already created baggage
-
-