otel

package module
Version: v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2020 License: Apache-2.0 Imports: 5 Imported by: 1,214

README

OpenTelemetry-Go

Circle CI Docs Go Report Card Gitter

The Go OpenTelemetry implementation.

Getting Started

OpenTelemetry's goal is to provide a single set of APIs to capture distributed traces and metrics from your application and send them to an observability platform. This project allows you to do just that for applications written in Go. There are two steps to this process: instrument your application, and configure an exporter.

Instrumentation

To start capturing distributed traces and metric events from your application it first needs to be instrumented. The easiest way to do this is by using an instrumentation library for your code. Be sure to check out the officially supported instrumentation libraries.

If you need to extend the telemetry an instrumentation library provides or want to build your own instrumentation for your application directly you will need to use the go.opentelemetry.io/otel/api package. The included examples are a good way to see some practical uses of this process.

Export

Now that your application is instrumented to collect telemetry, it needs an export pipeline to send that telemetry to an observability platform.

You can find officially supported exporters here and in the companion contrib repository. Additionally, there are many vendor specific or 3rd party exporters for OpenTelemetry. These exporters are broken down by trace and metric support.

Project Status

Project boards and milestones can be found at the respective links. We try to keep these accurate and should be the best place to go for answers on project status.

Contributing

See the contributing documentation.

Documentation

Overview

Package otel contains OpenTelemetry Go packages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Baggage added in v0.13.0

func Baggage(ctx context.Context) label.Set

Baggage returns a copy of the baggage in ctx.

func BaggageValue added in v0.13.0

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 added in v0.13.0

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

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

func ContextWithoutBaggage added in v0.13.0

func ContextWithoutBaggage(parent context.Context) context.Context

ContextWithoutBaggage returns a copy of parent without baggage.

func ContextWithoutBaggageValues added in v0.13.0

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 added in v0.11.0

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 added in v0.13.0

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 added in v0.13.0

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 added in v0.13.0

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

Directories

Path Synopsis
api
apitest
Package apitest provides utilities for testing.
Package apitest provides utilities for testing.
global
Package global provides global providers, propagators and more.
Package global provides global providers, propagators and more.
metric
Package metric provides support for reporting measurements using instruments.
Package metric provides support for reporting measurements using instruments.
metric/metrictest
Package metrictest contains utilities for testing metrics.
Package metrictest contains utilities for testing metrics.
trace
Package trace provides tracing support.
Package trace provides tracing support.
trace/tracetest
Package tracetest provides testing utilities for tracing.
Package tracetest provides testing utilities for tracing.
bridge
opencensus Module
opentracing Module
Package codes defines the canonical error codes used by OpenTelemetry.
Package codes defines the canonical error codes used by OpenTelemetry.
example
basic Module
fib Module
grpc Module
http Module
jaeger Module
namedtracer Module
opencensus Module
passthrough Module
prometheus Module
zipkin Module
exporter
trace/jaeger Module
exporters
jaeger Module
otlp Module
prometheus Module
stdout Module
trace/jaeger Module
trace/zipkin Module
zipkin Module
Package label provides key and value labels.
Package label provides key and value labels.
metric module
oteltest module
Package propagators contains OpenTelemetry context propagators.
Package propagators contains OpenTelemetry context propagators.
schema module
sdk module
export/metric Module
metric Module
Package semconv implements OpenTelemetry semantic conventions.
Package semconv implements OpenTelemetry semantic conventions.
trace module
Package unit provides units.
Package unit provides units.
baggage
Package baggage provides types and functions to manage W3C Baggage.
Package baggage provides types and functions to manage W3C Baggage.
trace/noop
Package noop provides noop tracing implementations for tracer and span.
Package noop provides noop tracing implementations for tracer and span.
metric Module
tools Module

Jump to

Keyboard shortcuts

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