Interface BaggageManager

All Known Subinterfaces:
Tracer

public interface BaggageManager
Manages Baggage entries. Upon retrieval / creation of a baggage entry puts it in scope. Scope must be closed.
Since:
1.0.0
  • Field Details

  • Method Details

    • getAllBaggage

      Map<String,String> getAllBaggage()
      Returns:
      mapping of all baggage entries from the given scope
    • getAllBaggage

      default Map<String,String> getAllBaggage(@Nullable TraceContext traceContext)
      Parameters:
      traceContext - trace context with baggage. If null will try to get all baggage from current available context
      Returns:
      mapping of all baggage entries from the given scope
    • getBaggage

      Baggage getBaggage(String name)
      Retrieves Baggage for the given name.
      Parameters:
      name - baggage name
      Returns:
      baggage if present or creates a new one if missing with null value
    • getBaggage

      @Nullable Baggage getBaggage(TraceContext traceContext, String name)
      Retrieves Baggage for the given name.
      Parameters:
      traceContext - trace context with baggage attached to it
      name - baggage name
      Returns:
      baggage or null if not present on the TraceContext
    • createBaggage

      @Deprecated 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 - baggage name
      Returns:
      new or already created baggage
    • createBaggage

      @Deprecated 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 - baggage name
      value - baggage value
      Returns:
      new or already created baggage
    • createBaggageInScope

      default BaggageInScope createBaggageInScope(String name, String value)
      Creates a new Baggage entry, sets a value on it and puts it in scope.
      Parameters:
      name - baggage name
      value - baggage value
      Returns:
      baggage with value
    • createBaggageInScope

      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 - trace context with baggage attached to it
      name - baggage name
      value - baggage value
      Returns:
      baggage with value