Baggage represents collection of key-value pairs with optional metadata. Each key of Baggage is associated with exactly one value. Baggage may be used to annotate and enrich telemetry data.

1.0.0

interface Baggage {
    clear(): @opentelemetry/api.Baggage;
    getAllEntries(): [string, @opentelemetry/api.BaggageEntry][];
    getEntry(key: string): undefined | @opentelemetry/api.BaggageEntry;
    removeEntries(...key: string[]): @opentelemetry/api.Baggage;
    removeEntry(key: string): @opentelemetry/api.Baggage;
    setEntry(
        key: string,
        entry: @opentelemetry/api.BaggageEntry,
    ): @opentelemetry/api.Baggage;
}

Methods

  • Returns a new baggage with the entries from the current bag except the removed entries

    Parameters

    • ...key: string[]

      keys identifying the entries to be removed

    Returns @opentelemetry/api.Baggage

  • Returns a new baggage with the entries from the current bag except the removed entry

    Parameters

    • key: string

      key identifying the entry to be removed

    Returns @opentelemetry/api.Baggage