package otel
import "go.opentelemetry.io/otel"
Package otel contains OpenTelemetry Go packages.
Index ¶
- func Baggage(ctx context.Context) label.Set
- func BaggageValue(ctx context.Context, key label.Key) label.Value
- func ContextWithBaggageValues(parent context.Context, pairs ...label.KeyValue) context.Context
- func ContextWithoutBaggage(parent context.Context) context.Context
- func ContextWithoutBaggageValues(parent context.Context, keys ...label.Key) context.Context
- type ErrorHandler
- type Meter
- type TextMapCarrier
- type TextMapPropagator
- type Tracer
Functions ¶
func Baggage ¶
Baggage returns a copy of the baggage in ctx.
func BaggageValue ¶
BaggageValue returns the value related to key in the baggage of ctx. If no value is set, the returned label.Value will be an uninitialized zero-value with type INVALID.
func ContextWithBaggageValues ¶
ContextWithBaggageValues returns a copy of parent with pairs updated in the baggage.
func ContextWithoutBaggage ¶
ContextWithoutBaggage returns a copy of parent without baggage.
func ContextWithoutBaggageValues ¶
ContextWithoutBaggageValues returns a copy of parent in which the values related to keys have been removed from the baggage.
Types ¶
type ErrorHandler ¶
type ErrorHandler interface { // Handle handles any error deemed irremediable by an OpenTelemetry // component. Handle(error) }
ErrorHandler handles irremediable events.
type Meter ¶
type TextMapCarrier ¶
type TextMapCarrier interface { // Get returns the value associated with the passed key. Get(key string) string // Set stores the key-value pair. Set(key string, value string) }
TextMapCarrier is the storage medium used by a TextMapPropagator.
type TextMapPropagator ¶
type TextMapPropagator interface { // Inject set cross-cutting concerns from the Context into the carrier. Inject(ctx context.Context, carrier TextMapCarrier) // Extract reads cross-cutting concerns from the carrier into a Context. Extract(ctx context.Context, carrier TextMapCarrier) context.Context // Fields returns the keys who's values are set with Inject. Fields() []string }
TextMapPropagator propagates cross-cutting concerns as key-value text pairs within a carrier that travels in-band across process boundaries.
func NewCompositeTextMapPropagator ¶
func NewCompositeTextMapPropagator(p ...TextMapPropagator) TextMapPropagator
NewCompositeTextMapPropagator returns a unified TextMapPropagator from the group of passed TextMapPropagator. This allows different cross-cutting concerns to be propagates in a unified manner.
The returned TextMapPropagator will inject and extract cross-cutting concerns in the order the TextMapPropagators were provided. Additionally, the Fields method will return a de-duplicated slice of the keys that are set with the Inject method.
type Tracer ¶
Source Files ¶
baggage.go doc.go otel.go propagation.go
Directories ¶
Path | Synopsis |
---|---|
api | |
api/apitest | Package apitest provides utilities for testing. |
api/global | Package global provides global providers, propagators and more. |
api/global/internal | |
api/metric | Package metric provides support for reporting measurements using instruments. |
api/metric/metrictest | Package metrictest contains utilities for testing metrics. |
api/metric/registry | |
api/trace | Package trace provides tracing support. |
api/trace/tracetest | Package tracetest provides testing utilities for tracing. |
codes | Package codes defines the canonical error codes used by OpenTelemetry. |
internal | |
label | Package label provides key and value labels. |
propagators | Package propagators contains OpenTelemetry context propagators. |
semconv | Package semconv implements OpenTelemetry semantic conventions. |
unit | Package unit provides units. |
- Version
- v0.13.0
- Published
- Oct 8, 2020
- Platform
- linux/amd64
- Imports
- 5 packages
- Last checked
- 55 minutes ago –
Tools for package owners.