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(): Baggage;
    getAllEntries(): [string, BaggageEntry][];
    getEntry(key: string): undefined | BaggageEntry;
    removeEntries(...key: string[]): Baggage;
    removeEntry(key: string): Baggage;
    setEntry(key: string, entry: BaggageEntry): 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 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 Baggage

  • Returns a new baggage with the entries from the current bag and the specified entry

    Parameters

    • key: string

      string which identifies the baggage entry

    • entry: BaggageEntry

      BaggageEntry for the given key

    Returns Baggage