package otelutil
import "github.com/dotcloud/docker/internal/otelutil"
Index ¶
- Constants
- func MustNewBaggage(members ...baggage.Member) baggage.Baggage
- func MustNewMemberRaw(key, value string) baggage.Member
- func NewTracerProvider(ctx context.Context, allowNoop bool) (trace.TracerProvider, func(context.Context) error)
- func RecordStatus(span trace.Span, err error)
- type EnvironCarrier
Constants ¶
const TriggerKey = "trigger"
TriggerKey is the key used for the 'trigger' member in the baggage. It is used to know what triggered a code path (e.g. API call, libnet init, etc...)
Functions ¶
func MustNewBaggage ¶
MustNewBaggage creates an OTel Baggage containing the provided members. It panics if the baggage cannot be created.
DO NOT USE this function with dynamic values.
func MustNewMemberRaw ¶
MustNewMemberRaw creates an OTel Baggage member with the provided key and value. It panics if the key or value aren't valid UTF-8 strings.
DO NOT USE this function with dynamic key/value.
func NewTracerProvider ¶
func NewTracerProvider(ctx context.Context, allowNoop bool) (trace.TracerProvider, func(context.Context) error)
func RecordStatus ¶
RecordStatus records the status of a span based on the error provided.
If err is nil, the span status is unmodified. If err is not nil, the span takes status Error, and the error message is recorded.
Types ¶
type EnvironCarrier ¶
type EnvironCarrier struct { TraceParent, TraceState string }
func PropagateFromEnvironment ¶
func PropagateFromEnvironment() *EnvironCarrier
func (*EnvironCarrier) Environ ¶
func (c *EnvironCarrier) Environ() []string
func (*EnvironCarrier) Get ¶
func (c *EnvironCarrier) Get(key string) string
Get returns the value associated with the passed key.
func (*EnvironCarrier) Keys ¶
func (c *EnvironCarrier) Keys() []string
Keys lists the keys stored in this carrier.
func (*EnvironCarrier) Set ¶
func (c *EnvironCarrier) Set(key, value string)
Set stores the key-value pair.
Source Files ¶
baggage.go environ_carrier.go provider.go status.go
- Version
- v28.1.1+incompatible (latest)
- Published
- Apr 18, 2025
- Platform
- js/wasm
- Imports
- 11 packages
- Last checked
- 15 minutes ago –
Tools for package owners.