Package org.springframework.cloud.sleuth
Interface BaggageManager
-
- All Known Subinterfaces:
Tracer
public interface BaggageManagerManagesBaggageInScopeentries. 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 BaggageInScopecreateBaggage(String name)Creates a newBaggageInScopeentry for the given name or returns an existing one if it's already present.BaggageInScopecreateBaggage(String name, String value)Creates a newBaggageInScopeentry for the given name or returns an existing one if it's already present.Map<String,String>getAllBaggage()BaggageInScopegetBaggage(String name)RetrievesBaggageInScopefor the given name.BaggageInScopegetBaggage(TraceContext traceContext, String name)RetrievesBaggageInScopefor 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)
RetrievesBaggageInScopefor the given name.- Parameters:
name- baggage name- Returns:
- baggage or
nullif not present
-
getBaggage
@Nullable BaggageInScope getBaggage(TraceContext traceContext, String name)
RetrievesBaggageInScopefor the given name.- Parameters:
traceContext- trace context with baggage attached to itname- baggage name- Returns:
- baggage or
nullif not present
-
createBaggage
BaggageInScope createBaggage(String name)
Creates a newBaggageInScopeentry 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 newBaggageInScopeentry 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
-
-