otel – go.opentelemetry.io/otel Index | Files | Directories

package otel

import "go.opentelemetry.io/otel"

Package otel contains OpenTelemetry Go packages.

Index

Functions

func Baggage

func Baggage(ctx context.Context) label.Set

Baggage returns a copy of the baggage in ctx.

func BaggageValue

func BaggageValue(ctx context.Context, key label.Key) label.Value

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

func ContextWithBaggageValues(parent context.Context, pairs ...label.KeyValue) context.Context

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

func ContextWithoutBaggage

func ContextWithoutBaggage(parent context.Context) context.Context

ContextWithoutBaggage returns a copy of parent without baggage.

func ContextWithoutBaggageValues

func ContextWithoutBaggageValues(parent context.Context, keys ...label.Key) context.Context

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 Meter = metric.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

type Tracer = trace.Tracer

Source Files

baggage.go doc.go otel.go propagation.go

Directories

PathSynopsis
api
api/apitestPackage apitest provides utilities for testing.
api/globalPackage global provides global providers, propagators and more.
api/global/internal
api/metricPackage metric provides support for reporting measurements using instruments.
api/metric/metrictestPackage metrictest contains utilities for testing metrics.
api/metric/registry
api/tracePackage trace provides tracing support.
api/trace/tracetestPackage tracetest provides testing utilities for tracing.
codesPackage codes defines the canonical error codes used by OpenTelemetry.
internal
labelPackage label provides key and value labels.
propagatorsPackage propagators contains OpenTelemetry context propagators.
semconvPackage semconv implements OpenTelemetry semantic conventions.
unitPackage 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.