String to BaggageEntry that can be used to label anything that is
associated with a specific operation.
For example, Baggages can be used to label stats, log messages, or debugging
information.
Implementations of this interface *must* be immutable and have well-defined value-based equals/hashCode implementations. If an implementation does not strictly conform to these requirements, behavior of the OpenTelemetry APIs and default SDK cannot be guaranteed.
For this reason, it is strongly suggested that you use the implementation that is provided
here via the factory methods and the BaggageBuilder.
| Modifier and Type | Method and Description |
|---|---|
| public Map | |
| public static BaggageBuilder | |
| public static Baggage | |
| public static Baggage | |
| public void | forEach(BiConsumer<? super String, ? super BaggageEntry> consumer)
Iterates over all the entries in this |
| public static Baggage | fromContext(Context context)
Returns the |
| public static Baggage | fromContextOrNull(Context context)
Returns the |
| public default BaggageEntry | |
| public String | Returns: the value associated with the given key, ornull if no Entry with the
given entryKey is in this Baggage.entry key to return the value for. entryKey)Returns the |
| public default boolean | |
| public int | |
| public default Context | storeInContext(Context context)
Implements io. Returns a new |
| public BaggageBuilder |
| asMap | back to summary |
|---|---|
| public Map | |
| builder | back to summary |
|---|---|
| public static BaggageBuilder builder() Creates a new | |
| current | back to summary |
|---|---|
| public static Baggage current() Returns Baggage from the current | |
| empty | back to summary |
|---|---|
| public static Baggage empty() Baggage with no entries. | |
| forEach | back to summary |
|---|---|
| public void forEach(BiConsumer<? super String, ? super BaggageEntry> consumer) Iterates over all the entries in this | |
| fromContext | back to summary |
|---|---|
| public static Baggage fromContext(Context context) Returns the | |
| fromContextOrNull | back to summary |
|---|---|
| public static Baggage fromContextOrNull(Context context) Returns the
| |
| getEntry | back to summary |
|---|---|
| public default BaggageEntry getEntry(String entryKey) Returns the | |
| getEntryValue | back to summary |
|---|---|
| public String getEntryValue(String entryKey) Returns the | |
| isEmpty | back to summary |
|---|---|
| public default boolean isEmpty() Returns whether this | |
| size | back to summary |
|---|---|
| public int size() Returns the number of entries in this | |
| storeInContext | back to summary |
|---|---|
| public default Context storeInContext(Context context) Implements io. Doc from io. Returns a new
| |
| toBuilder | back to summary |
|---|---|
| public BaggageBuilder toBuilder() Create a Builder pre-initialized with the contents of this Baggage. The returned Builder will be set to not use an implicit parent, so any parent assignment must be done manually. | |