Interface BaggageManager

  • All Known Subinterfaces:
    Tracer

    public interface BaggageManager
    Manages BaggageInScope 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 Detail

      • getAllBaggage

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

        @Nullable
        BaggageInScope getBaggage​(String name)
        Retrieves BaggageInScope for the given name.
        Parameters:
        name - baggage name
        Returns:
        baggage or null if not present
      • getBaggage

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

        BaggageInScope createBaggage​(String name)
        Creates a new BaggageInScope 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 new BaggageInScope 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