Version: v0.18.0 Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Mar 3, 2021 License: Apache-2.0 Imports: 3 Imported by: 231



Package baggage provides functionality for storing and retrieving baggage items in Go context. For propagating the baggage, see the package.

This package is currently in a pre-GA phase. Backwards incompatible changes may be introduced in subsequent minor version releases as we work to track the evolving OpenTelemetry specification and user feedback.



This section is empty.


This section is empty.


func ContextWithEmpty

func ContextWithEmpty(parent context.Context) context.Context

ContextWithEmpty returns a copy of parent without baggage.

func ContextWithValues

func ContextWithValues(parent context.Context, pairs ...attribute.KeyValue) context.Context

ContextWithValues returns a copy of parent with pairs updated in the baggage.

func ContextWithoutValues

func ContextWithoutValues(parent context.Context, keys ...attribute.Key) context.Context

ContextWithoutValues returns a copy of parent in which the values related to keys have been removed from the baggage.

func Set

func Set(ctx context.Context) attribute.Set

Set returns a copy of the set of baggage key-values in ctx.

func Value

func Value(ctx context.Context, key attribute.Key) attribute.Value

Value returns the value related to key in the baggage of ctx. If no value is set, the returned attribute.Value will be an uninitialized zero-value with type INVALID.


This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL