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

package otel

import "go.opentelemetry.io/otel"

Package otel provides an implementation of the OpenTelemetry API.

The provided API is used to instrument code and measure data about that code's performance and operation. The measured data, by default, is not processed or transmitted anywhere. An implementation of the OpenTelemetry SDK, like the default SDK implementation (go.opentelemetry.io/otel/sdk), and associated exporters are used to process and transport this data.

Tracing

To participate in distributed traces a Span needs to be created for the operation being performed as part of a traced workflow. It its simplest form:

var tracer otel.Tracer

func init() {
	tracer := global.Tracer("instrumentation/package/name")
}

func operation(ctx context.Context) {
	var span trace.Span
	ctx, span = tracer.Start(ctx, "operation")
	defer span.End()
	// ...
}

A Tracer is unique to the instrumentation and is used to create Spans. Instrumentation should be designed to accept a TracerProvider from which it can create its own unique Tracer. Alternatively, the registered global TracerProvider from the go.opentelemetry.io/otel/global package can be used as a default.

const (
	name    = "instrumentation/package/name"
	version = "0.1.0"
)

type Instrumentation struct {
	tracer otel.Tracer
}

func NewInstrumentation(tp otel.TracerProvider) *Instrumentation {
	if tp == nil {
		tp := global.TracerProvider()
	}
	return &Instrumentation{
		tracer: tp.Tracer(name, otel.WithTracerVersion(version)),
	}
}

func operation(ctx context.Context, inst *Instrumentation) {
	var span trace.Span
	ctx, span = inst.tracer.Start(ctx, "operation")
	defer span.End()
	// ...
}

Metric Measurements

Measurements can be made about an operation being performed or the state of a system in general. These measurements can be crucial to the reliable operation of code and provide valuable insights about the inner workings of a system.

Measurements are made using instruments provided by this package. The type of instrument used will depend on the type of measurement being made and of what part of a system is being measured.

Instruments are categorized as Synchronous or Asynchronous and independently as Adding or Grouping. Synchronous instruments are called by the user with a Context. Asynchronous instruments are called by the SDK during collection. Additive instruments are semantically intended for capturing a sum. Grouping instruments are intended for capturing a distribution.

Additive instruments may be monotonic, in which case they are non-decreasing and naturally define a rate.

The synchronous instrument names are:

Counter:           additive, monotonic
UpDownCounter:     additive
ValueRecorder:     grouping

and the asynchronous instruments are:

SumObserver:       additive, monotonic
UpDownSumObserver: additive
ValueObserver:     grouping

All instruments are provided with support for either float64 or int64 input values.

An instrument is created using a Meter. Additionally, a Meter is used to record batches of synchronous measurements or asynchronous observations. A Meter is obtained using a MeterProvider. A Meter, like a Tracer, is unique to the instrumentation it instruments and must be named and versioned when created with a MeterProvider with the name and version of the instrumentation library.

Instrumentation should be designed to accept a MeterProvider from which it can create its own unique Meter. Alternatively, the registered global MeterProvider from the go.opentelemetry.io/otel/api/global package can be used as a default.

Index

Package Files

baggage.go config.go doc.go error_handler.go instrumentkind_string.go metric.go metric_instrument.go metric_noop.go metric_sdkapi.go number.go numberkind_string.go propagation.go trace.go trace_noop.go

Constants

const (
    // FlagsSampled is a bitmask with the sampled bit set. A SpanContext
    // with the sampling bit set means the span is sampled.
    FlagsSampled = byte(0x01)
    // FlagsDeferred is a bitmask with the deferred bit set. A SpanContext
    // with the deferred bit set means the sampling decision has been
    // defered to the receiver.
    FlagsDeferred = byte(0x02)
    // FlagsDebug is a bitmask with the debug bit set.
    FlagsDebug = byte(0x04)
)

Variables

var ErrSDKReturnedNilImpl = errors.New("SDK returned a nil implementation")

ErrSDKReturnedNilImpl is returned when a new `MeterImpl` returns nil.

func Baggage Uses

func Baggage(ctx context.Context) label.Set

Baggage returns a copy of the baggage in ctx.

func BaggageValue Uses

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 Uses

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

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

func ContextWithRemoteSpanContext Uses

func ContextWithRemoteSpanContext(parent context.Context, remote SpanContext) context.Context

ContextWithRemoteSpanContext returns a copy of parent with a remote set as the remote span context.

func ContextWithSpan Uses

func ContextWithSpan(parent context.Context, span Span) context.Context

ContextWithSpan returns a copy of parent with span set to current.

func ContextWithoutBaggage Uses

func ContextWithoutBaggage(parent context.Context) context.Context

ContextWithoutBaggage returns a copy of parent without baggage.

func ContextWithoutBaggageValues Uses

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.

type AsyncBatchRunner Uses

type AsyncBatchRunner interface {
    // Run accepts a function for capturing observations of
    // multiple instruments.
    Run(ctx context.Context, capture func([]label.KeyValue, ...Observation))

    AsyncRunner
}

AsyncBatchRunner is an interface implemented by batch-observer callbacks.

type AsyncImpl Uses

type AsyncImpl interface {
    InstrumentImpl
}

AsyncImpl is an implementation-level interface to an asynchronous instrument (e.g., Observer instruments).

type AsyncRunner Uses

type AsyncRunner interface {
    // AnyRunner() is a non-exported method with no functional use
    // other than to make this a non-empty interface.
    AnyRunner()
}

AsyncRunner is expected to convert into an AsyncSingleRunner or an AsyncBatchRunner. SDKs will encounter an error if the AsyncRunner does not satisfy one of these interfaces.

type AsyncSingleRunner Uses

type AsyncSingleRunner interface {
    // Run accepts a single instrument and function for capturing
    // observations of that instrument.  Each call to the function
    // receives one captured observation.  (The function accepts
    // multiple observations so the same implementation can be
    // used for batch runners.)
    Run(ctx context.Context, single AsyncImpl, capture func([]label.KeyValue, ...Observation))

    AsyncRunner
}

AsyncSingleRunner is an interface implemented by single-observer callbacks.

type BatchObserver Uses

type BatchObserver struct {
    // contains filtered or unexported fields
}

BatchObserver represents an Observer callback that can report observations for multiple instruments.

func (BatchObserver) NewFloat64SumObserver Uses

func (b BatchObserver) NewFloat64SumObserver(name string, opts ...InstrumentOption) (Float64SumObserver, error)

NewFloat64SumObserver creates a new floating point SumObserver with the given name, running in a batch callback, and customized with options. May return an error if the name is invalid (e.g., empty) or improperly registered (e.g., duplicate registration).

func (BatchObserver) NewFloat64UpDownSumObserver Uses

func (b BatchObserver) NewFloat64UpDownSumObserver(name string, opts ...InstrumentOption) (Float64UpDownSumObserver, error)

NewFloat64UpDownSumObserver creates a new floating point UpDownSumObserver with the given name, running in a batch callback, and customized with options. May return an error if the name is invalid (e.g., empty) or improperly registered (e.g., duplicate registration).

func (BatchObserver) NewFloat64ValueObserver Uses

func (b BatchObserver) NewFloat64ValueObserver(name string, opts ...InstrumentOption) (Float64ValueObserver, error)

NewFloat64ValueObserver creates a new floating point ValueObserver with the given name, running in a batch callback, and customized with options. May return an error if the name is invalid (e.g., empty) or improperly registered (e.g., duplicate registration).

func (BatchObserver) NewInt64SumObserver Uses

func (b BatchObserver) NewInt64SumObserver(name string, opts ...InstrumentOption) (Int64SumObserver, error)

NewInt64SumObserver creates a new integer SumObserver instrument with the given name, running in a batch callback, and customized with options. May return an error if the name is invalid (e.g., empty) or improperly registered (e.g., duplicate registration).

func (BatchObserver) NewInt64UpDownSumObserver Uses

func (b BatchObserver) NewInt64UpDownSumObserver(name string, opts ...InstrumentOption) (Int64UpDownSumObserver, error)

NewInt64UpDownSumObserver creates a new integer UpDownSumObserver instrument with the given name, running in a batch callback, and customized with options. May return an error if the name is invalid (e.g., empty) or improperly registered (e.g., duplicate registration).

func (BatchObserver) NewInt64ValueObserver Uses

func (b BatchObserver) NewInt64ValueObserver(name string, opts ...InstrumentOption) (Int64ValueObserver, error)

NewInt64ValueObserver creates a new integer ValueObserver instrument with the given name, running in a batch callback, and customized with options. May return an error if the name is invalid (e.g., empty) or improperly registered (e.g., duplicate registration).

type BatchObserverFunc Uses

type BatchObserverFunc func(context.Context, BatchObserverResult)

BatchObserverFunc is a callback argument for use with any Observer instrument that will be reported as a batch of observations.

func (*BatchObserverFunc) AnyRunner Uses

func (*BatchObserverFunc) AnyRunner()

AnyRunner implements AsyncRunner.

func (*BatchObserverFunc) Run Uses

func (b *BatchObserverFunc) Run(ctx context.Context, function func([]label.KeyValue, ...Observation))

Run implements AsyncBatchRunner.

type BatchObserverMust Uses

type BatchObserverMust struct {
    // contains filtered or unexported fields
}

BatchObserverMust is a wrapper for BatchObserver that panics when any instrument constructor encounters an error.

func (BatchObserverMust) NewFloat64SumObserver Uses

func (bm BatchObserverMust) NewFloat64SumObserver(name string, oos ...InstrumentOption) Float64SumObserver

NewFloat64SumObserver calls `BatchObserver.NewFloat64SumObserver` and returns the instrument, panicking if it encounters an error.

func (BatchObserverMust) NewFloat64UpDownSumObserver Uses

func (bm BatchObserverMust) NewFloat64UpDownSumObserver(name string, oos ...InstrumentOption) Float64UpDownSumObserver

NewFloat64UpDownSumObserver calls `BatchObserver.NewFloat64UpDownSumObserver` and returns the instrument, panicking if it encounters an error.

func (BatchObserverMust) NewFloat64ValueObserver Uses

func (bm BatchObserverMust) NewFloat64ValueObserver(name string, oos ...InstrumentOption) Float64ValueObserver

NewFloat64ValueObserver calls `BatchObserver.NewFloat64ValueObserver` and returns the instrument, panicking if it encounters an error.

func (BatchObserverMust) NewInt64SumObserver Uses

func (bm BatchObserverMust) NewInt64SumObserver(name string, oos ...InstrumentOption) Int64SumObserver

NewInt64SumObserver calls `BatchObserver.NewInt64SumObserver` and returns the instrument, panicking if it encounters an error.

func (BatchObserverMust) NewInt64UpDownSumObserver Uses

func (bm BatchObserverMust) NewInt64UpDownSumObserver(name string, oos ...InstrumentOption) Int64UpDownSumObserver

NewInt64UpDownSumObserver calls `BatchObserver.NewInt64UpDownSumObserver` and returns the instrument, panicking if it encounters an error.

func (BatchObserverMust) NewInt64ValueObserver Uses

func (bm BatchObserverMust) NewInt64ValueObserver(name string, oos ...InstrumentOption) Int64ValueObserver

NewInt64ValueObserver calls `BatchObserver.NewInt64ValueObserver` and returns the instrument, panicking if it encounters an error.

type BatchObserverResult Uses

type BatchObserverResult struct {
    // contains filtered or unexported fields
}

BatchObserverResult is passed to a batch observer callback to capture observations for multiple asynchronous instruments.

func (BatchObserverResult) Observe Uses

func (br BatchObserverResult) Observe(labels []label.KeyValue, obs ...Observation)

Observe captures a multiple observations from the associated batch instrument callback, with the given labels.

type BoundFloat64Counter Uses

type BoundFloat64Counter struct {
    // contains filtered or unexported fields
}

BoundFloat64Counter is a bound instrument for Float64Counter.

It inherits the Unbind function from syncBoundInstrument.

func (BoundFloat64Counter) Add Uses

func (b BoundFloat64Counter) Add(ctx context.Context, value float64)

Add adds the value to the counter's sum using the labels previously bound to this counter via Bind()

func (BoundFloat64Counter) Unbind Uses

func (h BoundFloat64Counter) Unbind()

Unbind calls SyncImpl.Unbind.

type BoundFloat64UpDownCounter Uses

type BoundFloat64UpDownCounter struct {
    // contains filtered or unexported fields
}

BoundFloat64UpDownCounter is a bound instrument for Float64UpDownCounter.

It inherits the Unbind function from syncBoundInstrument.

func (BoundFloat64UpDownCounter) Add Uses

func (b BoundFloat64UpDownCounter) Add(ctx context.Context, value float64)

Add adds the value to the counter's sum using the labels previously bound to this counter via Bind()

func (BoundFloat64UpDownCounter) Unbind Uses

func (h BoundFloat64UpDownCounter) Unbind()

Unbind calls SyncImpl.Unbind.

type BoundFloat64ValueRecorder Uses

type BoundFloat64ValueRecorder struct {
    // contains filtered or unexported fields
}

BoundFloat64ValueRecorder is a bound instrument for Float64ValueRecorder.

It inherits the Unbind function from syncBoundInstrument.

func (BoundFloat64ValueRecorder) Record Uses

func (b BoundFloat64ValueRecorder) Record(ctx context.Context, value float64)

Record adds a new value to the ValueRecorder's distribution using the labels previously bound to the ValueRecorder via Bind().

func (BoundFloat64ValueRecorder) Unbind Uses

func (h BoundFloat64ValueRecorder) Unbind()

Unbind calls SyncImpl.Unbind.

type BoundInt64Counter Uses

type BoundInt64Counter struct {
    // contains filtered or unexported fields
}

BoundInt64Counter is a boundInstrument for Int64Counter.

It inherits the Unbind function from syncBoundInstrument.

func (BoundInt64Counter) Add Uses

func (b BoundInt64Counter) Add(ctx context.Context, value int64)

Add adds the value to the counter's sum using the labels previously bound to this counter via Bind()

func (BoundInt64Counter) Unbind Uses

func (h BoundInt64Counter) Unbind()

Unbind calls SyncImpl.Unbind.

type BoundInt64UpDownCounter Uses

type BoundInt64UpDownCounter struct {
    // contains filtered or unexported fields
}

BoundInt64UpDownCounter is a boundInstrument for Int64UpDownCounter.

It inherits the Unbind function from syncBoundInstrument.

func (BoundInt64UpDownCounter) Add Uses

func (b BoundInt64UpDownCounter) Add(ctx context.Context, value int64)

Add adds the value to the counter's sum using the labels previously bound to this counter via Bind()

func (BoundInt64UpDownCounter) Unbind Uses

func (h BoundInt64UpDownCounter) Unbind()

Unbind calls SyncImpl.Unbind.

type BoundInt64ValueRecorder Uses

type BoundInt64ValueRecorder struct {
    // contains filtered or unexported fields
}

BoundInt64ValueRecorder is a bound instrument for Int64ValueRecorder.

It inherits the Unbind function from syncBoundInstrument.

func (BoundInt64ValueRecorder) Record Uses

func (b BoundInt64ValueRecorder) Record(ctx context.Context, value int64)

Record adds a new value to the ValueRecorder's distribution using the labels previously bound to the ValueRecorder via Bind().

func (BoundInt64ValueRecorder) Unbind Uses

func (h BoundInt64ValueRecorder) Unbind()

Unbind calls SyncImpl.Unbind.

type BoundSyncImpl Uses

type BoundSyncImpl interface {

    // RecordOne captures a single synchronous metric event.
    RecordOne(ctx context.Context, number Number)

    // Unbind frees the resources associated with this bound instrument. It
    // does not affect the metric this bound instrument was created through.
    Unbind()
}

BoundSyncImpl is the implementation-level interface to a generic bound synchronous instrument

type Descriptor Uses

type Descriptor struct {
    // contains filtered or unexported fields
}

Descriptor contains all the settings that describe an instrument, including its name, metric kind, number kind, and the configurable options.

func NewDescriptor Uses

func NewDescriptor(name string, ikind InstrumentKind, nkind NumberKind, opts ...InstrumentOption) Descriptor

NewDescriptor returns a Descriptor with the given contents.

func (Descriptor) Description Uses

func (d Descriptor) Description() string

Description provides a human-readable description of the metric instrument.

func (Descriptor) InstrumentKind Uses

func (d Descriptor) InstrumentKind() InstrumentKind

InstrumentKind returns the specific kind of instrument.

func (Descriptor) InstrumentationName Uses

func (d Descriptor) InstrumentationName() string

InstrumentationName returns the name of the library that provided instrumentation for this instrument.

func (Descriptor) InstrumentationVersion Uses

func (d Descriptor) InstrumentationVersion() string

InstrumentationVersion returns the version of the library that provided instrumentation for this instrument.

func (Descriptor) Name Uses

func (d Descriptor) Name() string

Name returns the metric instrument's name.

func (Descriptor) NumberKind Uses

func (d Descriptor) NumberKind() NumberKind

NumberKind returns whether this instrument is declared over int64, float64, or uint64 values.

func (Descriptor) Unit Uses

func (d Descriptor) Unit() unit.Unit

Unit describes the units of the metric instrument. Unitless metrics return the empty string.

type ErrorHandler Uses

type ErrorHandler interface {
    // Handle handles any error deemed irremediable by an OpenTelemetry
    // component.
    Handle(error)
}

ErrorHandler handles irremediable events.

type EventOption Uses

type EventOption interface {
    ApplyEvent(*SpanConfig)
}

EventOption applies span event options to a SpanConfig.

type Float64Counter Uses

type Float64Counter struct {
    // contains filtered or unexported fields
}

Float64Counter is a metric that accumulates float64 values.

func (Float64Counter) Add Uses

func (c Float64Counter) Add(ctx context.Context, value float64, labels ...label.KeyValue)

Add adds the value to the counter's sum. The labels should contain the keys and values to be associated with this value.

func (Float64Counter) Bind Uses

func (c Float64Counter) Bind(labels ...label.KeyValue) (h BoundFloat64Counter)

Bind creates a bound instrument for this counter. The labels are associated with values recorded via subsequent calls to Record.

func (Float64Counter) Measurement Uses

func (c Float64Counter) Measurement(value float64) Measurement

Measurement creates a Measurement object to use with batch recording.

func (Float64Counter) SyncImpl Uses

func (s Float64Counter) SyncImpl() SyncImpl

SyncImpl returns the implementation object for synchronous instruments.

type Float64ObserverFunc Uses

type Float64ObserverFunc func(context.Context, Float64ObserverResult)

Float64ObserverFunc is a type of callback that floating point observers run.

func (*Float64ObserverFunc) AnyRunner Uses

func (*Float64ObserverFunc) AnyRunner()

AnyRunner implements AsyncRunner.

func (*Float64ObserverFunc) Run Uses

func (f *Float64ObserverFunc) Run(ctx context.Context, impl AsyncImpl, function func([]label.KeyValue, ...Observation))

Run implements AsyncSingleRunner.

type Float64ObserverResult Uses

type Float64ObserverResult struct {
    // contains filtered or unexported fields
}

Float64ObserverResult is passed to an observer callback to capture observations for one asynchronous floating point metric instrument.

func (Float64ObserverResult) Observe Uses

func (fr Float64ObserverResult) Observe(value float64, labels ...label.KeyValue)

Observe captures a single floating point value from the associated instrument callback, with the given labels.

type Float64SumObserver Uses

type Float64SumObserver struct {
    // contains filtered or unexported fields
}

Float64SumObserver is a metric that captures a precomputed sum of float64 values at a point in time.

func (Float64SumObserver) AsyncImpl Uses

func (a Float64SumObserver) AsyncImpl() AsyncImpl

AsyncImpl implements AsyncImpl.

func (Float64SumObserver) Observation Uses

func (f Float64SumObserver) Observation(v float64) Observation

Observation returns an Observation, a BatchObserverFunc argument, for an asynchronous integer instrument. This returns an implementation-level object for use by the SDK, users should not refer to this.

type Float64UpDownCounter Uses

type Float64UpDownCounter struct {
    // contains filtered or unexported fields
}

Float64UpDownCounter is a metric instrument that sums floating point values.

func (Float64UpDownCounter) Add Uses

func (c Float64UpDownCounter) Add(ctx context.Context, value float64, labels ...label.KeyValue)

Add adds the value to the counter's sum. The labels should contain the keys and values to be associated with this value.

func (Float64UpDownCounter) Bind Uses

func (c Float64UpDownCounter) Bind(labels ...label.KeyValue) (h BoundFloat64UpDownCounter)

Bind creates a bound instrument for this counter. The labels are associated with values recorded via subsequent calls to Record.

func (Float64UpDownCounter) Measurement Uses

func (c Float64UpDownCounter) Measurement(value float64) Measurement

Measurement creates a Measurement object to use with batch recording.

func (Float64UpDownCounter) SyncImpl Uses

func (s Float64UpDownCounter) SyncImpl() SyncImpl

SyncImpl returns the implementation object for synchronous instruments.

type Float64UpDownSumObserver Uses

type Float64UpDownSumObserver struct {
    // contains filtered or unexported fields
}

Float64UpDownSumObserver is a metric that captures a precomputed sum of float64 values at a point in time.

func (Float64UpDownSumObserver) AsyncImpl Uses

func (a Float64UpDownSumObserver) AsyncImpl() AsyncImpl

AsyncImpl implements AsyncImpl.

func (Float64UpDownSumObserver) Observation Uses

func (f Float64UpDownSumObserver) Observation(v float64) Observation

Observation returns an Observation, a BatchObserverFunc argument, for an asynchronous integer instrument. This returns an implementation-level object for use by the SDK, users should not refer to this.

type Float64ValueObserver Uses

type Float64ValueObserver struct {
    // contains filtered or unexported fields
}

Float64ValueObserver is a metric that captures a set of float64 values at a point in time.

func (Float64ValueObserver) AsyncImpl Uses

func (a Float64ValueObserver) AsyncImpl() AsyncImpl

AsyncImpl implements AsyncImpl.

func (Float64ValueObserver) Observation Uses

func (f Float64ValueObserver) Observation(v float64) Observation

Observation returns an Observation, a BatchObserverFunc argument, for an asynchronous integer instrument. This returns an implementation-level object for use by the SDK, users should not refer to this.

type Float64ValueRecorder Uses

type Float64ValueRecorder struct {
    // contains filtered or unexported fields
}

Float64ValueRecorder is a metric that records float64 values.

func (Float64ValueRecorder) Bind Uses

func (c Float64ValueRecorder) Bind(labels ...label.KeyValue) (h BoundFloat64ValueRecorder)

Bind creates a bound instrument for this ValueRecorder. The labels are associated with values recorded via subsequent calls to Record.

func (Float64ValueRecorder) Measurement Uses

func (c Float64ValueRecorder) Measurement(value float64) Measurement

Measurement creates a Measurement object to use with batch recording.

func (Float64ValueRecorder) Record Uses

func (c Float64ValueRecorder) Record(ctx context.Context, value float64, labels ...label.KeyValue)

Record adds a new value to the list of ValueRecorder's records. The labels should contain the keys and values to be associated with this value.

func (Float64ValueRecorder) SyncImpl Uses

func (s Float64ValueRecorder) SyncImpl() SyncImpl

SyncImpl returns the implementation object for synchronous instruments.

type InstrumentConfig Uses

type InstrumentConfig struct {
    // Description describes the instrument in human-readable terms.
    Description string
    // Unit describes the measurement unit for a instrument.
    Unit unit.Unit
    // InstrumentationName is the name of the library providing
    // instrumentation.
    InstrumentationName string
    // InstrumentationVersion is the version of the library providing
    // instrumentation.
    InstrumentationVersion string
}

InstrumentConfig contains options for metric instrument descriptors.

func NewInstrumentConfig Uses

func NewInstrumentConfig(opts ...InstrumentOption) InstrumentConfig

NewInstrumentConfig creates a new InstrumentConfig and applies all the given options.

type InstrumentImpl Uses

type InstrumentImpl interface {
    // Implementation returns the underlying implementation of the
    // instrument, which allows the implementation to gain access
    // to its own representation especially from a `Measurement`.
    Implementation() interface{}

    // Descriptor returns a copy of the instrument's Descriptor.
    Descriptor() Descriptor
}

InstrumentImpl is a common interface for synchronous and asynchronous instruments.

type InstrumentKind Uses

type InstrumentKind int8

InstrumentKind describes the kind of instrument.

const (
    // ValueRecorderInstrumentKind indicates a ValueRecorder instrument.
    ValueRecorderInstrumentKind InstrumentKind = iota
    // ValueObserverInstrumentKind indicates an ValueObserver instrument.
    ValueObserverInstrumentKind

    // CounterInstrumentKind indicates a Counter instrument.
    CounterInstrumentKind
    // UpDownCounterInstrumentKind indicates a UpDownCounter instrument.
    UpDownCounterInstrumentKind

    // SumObserverInstrumentKind indicates a SumObserver instrument.
    SumObserverInstrumentKind
    // UpDownSumObserverInstrumentKind indicates a UpDownSumObserver
    // instrument.
    UpDownSumObserverInstrumentKind
)

func (InstrumentKind) Adding Uses

func (k InstrumentKind) Adding() bool

Adding returns whether this kind of instrument adds its inputs (as opposed to Grouping).

func (InstrumentKind) Asynchronous Uses

func (k InstrumentKind) Asynchronous() bool

Asynchronous returns whether this is an asynchronous kind of instrument.

func (InstrumentKind) Grouping Uses

func (k InstrumentKind) Grouping() bool

Grouping returns whether this kind of instrument groups its inputs (as opposed to Adding).

func (InstrumentKind) Monotonic Uses

func (k InstrumentKind) Monotonic() bool

Monotonic returns whether this kind of instrument exposes a non-decreasing sum.

func (InstrumentKind) PrecomputedSum Uses

func (k InstrumentKind) PrecomputedSum() bool

PrecomputedSum returns whether this kind of instrument receives precomputed sums.

func (InstrumentKind) String Uses

func (i InstrumentKind) String() string

func (InstrumentKind) Synchronous Uses

func (k InstrumentKind) Synchronous() bool

Synchronous returns whether this is a synchronous kind of instrument.

type InstrumentOption Uses

type InstrumentOption interface {
    // ApplyMeter is used to set a InstrumentOption value of a
    // InstrumentConfig.
    ApplyInstrument(*InstrumentConfig)
}

InstrumentOption is an interface for applying metric instrument options.

func WithDescription Uses

func WithDescription(desc string) InstrumentOption

WithDescription applies provided description.

func WithInstrumentationName Uses

func WithInstrumentationName(name string) InstrumentOption

WithInstrumentationName sets the instrumentation name.

func WithUnit Uses

func WithUnit(unit unit.Unit) InstrumentOption

WithUnit applies provided unit.

type InstrumentationOption Uses

type InstrumentationOption interface {
    InstrumentOption
    MeterOption
    TracerOption
}

InstrumentationOption is an interface for applying instrumentation specific options.

func WithInstrumentationVersion Uses

func WithInstrumentationVersion(version string) InstrumentationOption

WithInstrumentationVersion sets the instrumentation version.

type Int64Counter Uses

type Int64Counter struct {
    // contains filtered or unexported fields
}

Int64Counter is a metric that accumulates int64 values.

func (Int64Counter) Add Uses

func (c Int64Counter) Add(ctx context.Context, value int64, labels ...label.KeyValue)

Add adds the value to the counter's sum. The labels should contain the keys and values to be associated with this value.

func (Int64Counter) Bind Uses

func (c Int64Counter) Bind(labels ...label.KeyValue) (h BoundInt64Counter)

Bind creates a bound instrument for this counter. The labels are associated with values recorded via subsequent calls to Record.

func (Int64Counter) Measurement Uses

func (c Int64Counter) Measurement(value int64) Measurement

Measurement creates a Measurement object to use with batch recording.

func (Int64Counter) SyncImpl Uses

func (s Int64Counter) SyncImpl() SyncImpl

SyncImpl returns the implementation object for synchronous instruments.

type Int64ObserverFunc Uses

type Int64ObserverFunc func(context.Context, Int64ObserverResult)

Int64ObserverFunc is a type of callback that integral observers run.

func (*Int64ObserverFunc) AnyRunner Uses

func (*Int64ObserverFunc) AnyRunner()

AnyRunner implements AsyncRunner.

func (*Int64ObserverFunc) Run Uses

func (i *Int64ObserverFunc) Run(ctx context.Context, impl AsyncImpl, function func([]label.KeyValue, ...Observation))

Run implements AsyncSingleRunner.

type Int64ObserverResult Uses

type Int64ObserverResult struct {
    // contains filtered or unexported fields
}

Int64ObserverResult is passed to an observer callback to capture observations for one asynchronous integer metric instrument.

func (Int64ObserverResult) Observe Uses

func (ir Int64ObserverResult) Observe(value int64, labels ...label.KeyValue)

Observe captures a single integer value from the associated instrument callback, with the given labels.

type Int64SumObserver Uses

type Int64SumObserver struct {
    // contains filtered or unexported fields
}

Int64SumObserver is a metric that captures a precomputed sum of int64 values at a point in time.

func (Int64SumObserver) AsyncImpl Uses

func (a Int64SumObserver) AsyncImpl() AsyncImpl

AsyncImpl implements AsyncImpl.

func (Int64SumObserver) Observation Uses

func (i Int64SumObserver) Observation(v int64) Observation

Observation returns an Observation, a BatchObserverFunc argument, for an asynchronous integer instrument. This returns an implementation-level object for use by the SDK, users should not refer to this.

type Int64UpDownCounter Uses

type Int64UpDownCounter struct {
    // contains filtered or unexported fields
}

Int64UpDownCounter is a metric instrument that sums integer values.

func (Int64UpDownCounter) Add Uses

func (c Int64UpDownCounter) Add(ctx context.Context, value int64, labels ...label.KeyValue)

Add adds the value to the counter's sum. The labels should contain the keys and values to be associated with this value.

func (Int64UpDownCounter) Bind Uses

func (c Int64UpDownCounter) Bind(labels ...label.KeyValue) (h BoundInt64UpDownCounter)

Bind creates a bound instrument for this counter. The labels are associated with values recorded via subsequent calls to Record.

func (Int64UpDownCounter) Measurement Uses

func (c Int64UpDownCounter) Measurement(value int64) Measurement

Measurement creates a Measurement object to use with batch recording.

func (Int64UpDownCounter) SyncImpl Uses

func (s Int64UpDownCounter) SyncImpl() SyncImpl

SyncImpl returns the implementation object for synchronous instruments.

type Int64UpDownSumObserver Uses

type Int64UpDownSumObserver struct {
    // contains filtered or unexported fields
}

Int64UpDownSumObserver is a metric that captures a precomputed sum of int64 values at a point in time.

func (Int64UpDownSumObserver) AsyncImpl Uses

func (a Int64UpDownSumObserver) AsyncImpl() AsyncImpl

AsyncImpl implements AsyncImpl.

func (Int64UpDownSumObserver) Observation Uses

func (i Int64UpDownSumObserver) Observation(v int64) Observation

Observation returns an Observation, a BatchObserverFunc argument, for an asynchronous integer instrument. This returns an implementation-level object for use by the SDK, users should not refer to this.

type Int64ValueObserver Uses

type Int64ValueObserver struct {
    // contains filtered or unexported fields
}

Int64ValueObserver is a metric that captures a set of int64 values at a point in time.

func (Int64ValueObserver) AsyncImpl Uses

func (a Int64ValueObserver) AsyncImpl() AsyncImpl

AsyncImpl implements AsyncImpl.

func (Int64ValueObserver) Observation Uses

func (i Int64ValueObserver) Observation(v int64) Observation

Observation returns an Observation, a BatchObserverFunc argument, for an asynchronous integer instrument. This returns an implementation-level object for use by the SDK, users should not refer to this.

type Int64ValueRecorder Uses

type Int64ValueRecorder struct {
    // contains filtered or unexported fields
}

Int64ValueRecorder is a metric that records int64 values.

func (Int64ValueRecorder) Bind Uses

func (c Int64ValueRecorder) Bind(labels ...label.KeyValue) (h BoundInt64ValueRecorder)

Bind creates a bound instrument for this ValueRecorder. The labels are associated with values recorded via subsequent calls to Record.

func (Int64ValueRecorder) Measurement Uses

func (c Int64ValueRecorder) Measurement(value int64) Measurement

Measurement creates a Measurement object to use with batch recording.

func (Int64ValueRecorder) Record Uses

func (c Int64ValueRecorder) Record(ctx context.Context, value int64, labels ...label.KeyValue)

Record adds a new value to the ValueRecorder's distribution. The labels should contain the keys and values to be associated with this value.

func (Int64ValueRecorder) SyncImpl Uses

func (s Int64ValueRecorder) SyncImpl() SyncImpl

SyncImpl returns the implementation object for synchronous instruments.

type LifeCycleOption Uses

type LifeCycleOption interface {
    SpanOption
    EventOption
}

LifeCycleOption applies span life-cycle options to a SpanConfig. These options set values releated to events in a spans life-cycle like starting, ending, experiencing an error and other user defined notable events.

func WithAttributes Uses

func WithAttributes(attributes ...label.KeyValue) LifeCycleOption

WithAttributes adds the attributes related to a span life-cycle event. These attributes are used to describe the work a Span represents when this option is provided to a Span's start or end events. Otherwise, these attributes provide additional information about the event being recorded (e.g. error, state change, processing progress, system event).

If multiple of these options are passed the attributes of each successive option will extend the attributes instead of overwriting. There is no guarantee of uniqueness in the resulting attributes.

func WithTimestamp Uses

func WithTimestamp(t time.Time) LifeCycleOption

WithTimestamp sets the time of a Span life-cycle moment (e.g. started, stopped, errored).

type Link struct {
    SpanContext
    Attributes []label.KeyValue
}

Link is the relationship between two Spans. The relationship can be within the same Trace or across different Traces.

For example, a Link is used in the following situations:

1. Batch Processing: A batch of operations may contain operations
   associated with one or more traces/spans. Since there can only be one
   parent SpanContext, a Link is used to keep reference to the
   SpanContext of all operations in the batch.
2. Public Endpoint: A SpanContext for an in incoming client request on a
   public endpoint should be considered untrusted. In such a case, a new
   trace with its own identity and sampling decision needs to be created,
   but this new trace needs to be related to the original trace in some
   form. A Link is used to keep reference to the original SpanContext and
   track the relationship.

type Measurement Uses

type Measurement struct {
    // contains filtered or unexported fields
}

Measurement is used for reporting a synchronous batch of metric values. Instances of this type should be created by synchronous instruments (e.g., Int64Counter.Measurement()).

func (Measurement) Number Uses

func (m Measurement) Number() Number

Number returns a number recorded in this measurement.

func (Measurement) SyncImpl Uses

func (m Measurement) SyncImpl() SyncImpl

SyncImpl returns the instrument that created this measurement. This returns an implementation-level object for use by the SDK, users should not refer to this.

type Meter Uses

type Meter struct {
    // contains filtered or unexported fields
}

Meter is the creator of metric instruments.

An uninitialized Meter is a no-op implementation.

func WrapMeterImpl Uses

func WrapMeterImpl(impl MeterImpl, instrumentationName string, opts ...MeterOption) Meter

WrapMeterImpl constructs a `Meter` implementation from a `MeterImpl` implementation.

func (Meter) MeterImpl Uses

func (m Meter) MeterImpl() MeterImpl

MeterImpl returns the underlying MeterImpl of this Meter.

func (Meter) NewBatchObserver Uses

func (m Meter) NewBatchObserver(callback BatchObserverFunc) BatchObserver

NewBatchObserver creates a new BatchObserver that supports making batches of observations for multiple instruments.

func (Meter) NewFloat64Counter Uses

func (m Meter) NewFloat64Counter(name string, options ...InstrumentOption) (Float64Counter, error)

NewFloat64Counter creates a new floating point Counter with the given name, customized with options. May return an error if the name is invalid (e.g., empty) or improperly registered (e.g., duplicate registration).

func (Meter) NewFloat64SumObserver Uses

func (m Meter) NewFloat64SumObserver(name string, callback Float64ObserverFunc, opts ...InstrumentOption) (Float64SumObserver, error)

NewFloat64SumObserver creates a new floating point SumObserver with the given name, running a given callback, and customized with options. May return an error if the name is invalid (e.g., empty) or improperly registered (e.g., duplicate registration).

func (Meter) NewFloat64UpDownCounter Uses

func (m Meter) NewFloat64UpDownCounter(name string, options ...InstrumentOption) (Float64UpDownCounter, error)

NewFloat64UpDownCounter creates a new floating point UpDownCounter with the given name, customized with options. May return an error if the name is invalid (e.g., empty) or improperly registered (e.g., duplicate registration).

func (Meter) NewFloat64UpDownSumObserver Uses

func (m Meter) NewFloat64UpDownSumObserver(name string, callback Float64ObserverFunc, opts ...InstrumentOption) (Float64UpDownSumObserver, error)

NewFloat64UpDownSumObserver creates a new floating point UpDownSumObserver with the given name, running a given callback, and customized with options. May return an error if the name is invalid (e.g., empty) or improperly registered (e.g., duplicate registration).

func (Meter) NewFloat64ValueObserver Uses

func (m Meter) NewFloat64ValueObserver(name string, callback Float64ObserverFunc, opts ...InstrumentOption) (Float64ValueObserver, error)

NewFloat64ValueObserver creates a new floating point ValueObserver with the given name, running a given callback, and customized with options. May return an error if the name is invalid (e.g., empty) or improperly registered (e.g., duplicate registration).

func (Meter) NewFloat64ValueRecorder Uses

func (m Meter) NewFloat64ValueRecorder(name string, opts ...InstrumentOption) (Float64ValueRecorder, error)

NewFloat64ValueRecorder creates a new floating point ValueRecorder with the given name, customized with options. May return an error if the name is invalid (e.g., empty) or improperly registered (e.g., duplicate registration).

func (Meter) NewInt64Counter Uses

func (m Meter) NewInt64Counter(name string, options ...InstrumentOption) (Int64Counter, error)

NewInt64Counter creates a new integer Counter instrument with the given name, customized with options. May return an error if the name is invalid (e.g., empty) or improperly registered (e.g., duplicate registration).

func (Meter) NewInt64SumObserver Uses

func (m Meter) NewInt64SumObserver(name string, callback Int64ObserverFunc, opts ...InstrumentOption) (Int64SumObserver, error)

NewInt64SumObserver creates a new integer SumObserver instrument with the given name, running a given callback, and customized with options. May return an error if the name is invalid (e.g., empty) or improperly registered (e.g., duplicate registration).

func (Meter) NewInt64UpDownCounter Uses

func (m Meter) NewInt64UpDownCounter(name string, options ...InstrumentOption) (Int64UpDownCounter, error)

NewInt64UpDownCounter creates a new integer UpDownCounter instrument with the given name, customized with options. May return an error if the name is invalid (e.g., empty) or improperly registered (e.g., duplicate registration).

func (Meter) NewInt64UpDownSumObserver Uses

func (m Meter) NewInt64UpDownSumObserver(name string, callback Int64ObserverFunc, opts ...InstrumentOption) (Int64UpDownSumObserver, error)

NewInt64UpDownSumObserver creates a new integer UpDownSumObserver instrument with the given name, running a given callback, and customized with options. May return an error if the name is invalid (e.g., empty) or improperly registered (e.g., duplicate registration).

func (Meter) NewInt64ValueObserver Uses

func (m Meter) NewInt64ValueObserver(name string, callback Int64ObserverFunc, opts ...InstrumentOption) (Int64ValueObserver, error)

NewInt64ValueObserver creates a new integer ValueObserver instrument with the given name, running a given callback, and customized with options. May return an error if the name is invalid (e.g., empty) or improperly registered (e.g., duplicate registration).

func (Meter) NewInt64ValueRecorder Uses

func (m Meter) NewInt64ValueRecorder(name string, opts ...InstrumentOption) (Int64ValueRecorder, error)

NewInt64ValueRecorder creates a new integer ValueRecorder instrument with the given name, customized with options. May return an error if the name is invalid (e.g., empty) or improperly registered (e.g., duplicate registration).

func (Meter) RecordBatch Uses

func (m Meter) RecordBatch(ctx context.Context, ls []label.KeyValue, ms ...Measurement)

RecordBatch atomically records a batch of measurements.

type MeterConfig Uses

type MeterConfig struct {
    // InstrumentationVersion is the version of the library providing
    // instrumentation.
    InstrumentationVersion string
}

MeterConfig contains options for Meters.

func NewMeterConfig Uses

func NewMeterConfig(opts ...MeterOption) MeterConfig

NewMeterConfig creates a new MeterConfig and applies all the given options.

type MeterImpl Uses

type MeterImpl interface {
    // RecordBatch atomically records a batch of measurements.
    RecordBatch(ctx context.Context, labels []label.KeyValue, measurement ...Measurement)

    // NewSyncInstrument returns a newly constructed
    // synchronous instrument implementation or an error, should
    // one occur.
    NewSyncInstrument(descriptor Descriptor) (SyncImpl, error)

    // NewAsyncInstrument returns a newly constructed
    // asynchronous instrument implementation or an error, should
    // one occur.
    NewAsyncInstrument(
        descriptor Descriptor,
        runner AsyncRunner,
    ) (AsyncImpl, error)
}

MeterImpl is the interface an SDK must implement to supply a Meter implementation.

type MeterMust Uses

type MeterMust struct {
    // contains filtered or unexported fields
}

MeterMust is a wrapper for Meter interfaces that panics when any instrument constructor encounters an error.

func Must Uses

func Must(meter Meter) MeterMust

Must constructs a MeterMust implementation from a Meter, allowing the application to panic when any instrument constructor yields an error.

func (MeterMust) NewBatchObserver Uses

func (mm MeterMust) NewBatchObserver(callback BatchObserverFunc) BatchObserverMust

NewBatchObserver returns a wrapper around BatchObserver that panics when any instrument constructor returns an error.

func (MeterMust) NewFloat64Counter Uses

func (mm MeterMust) NewFloat64Counter(name string, cos ...InstrumentOption) Float64Counter

NewFloat64Counter calls `Meter.NewFloat64Counter` and returns the instrument, panicking if it encounters an error.

func (MeterMust) NewFloat64SumObserver Uses

func (mm MeterMust) NewFloat64SumObserver(name string, callback Float64ObserverFunc, oos ...InstrumentOption) Float64SumObserver

NewFloat64SumObserver calls `Meter.NewFloat64SumObserver` and returns the instrument, panicking if it encounters an error.

func (MeterMust) NewFloat64UpDownCounter Uses

func (mm MeterMust) NewFloat64UpDownCounter(name string, cos ...InstrumentOption) Float64UpDownCounter

NewFloat64UpDownCounter calls `Meter.NewFloat64UpDownCounter` and returns the instrument, panicking if it encounters an error.

func (MeterMust) NewFloat64UpDownSumObserver Uses

func (mm MeterMust) NewFloat64UpDownSumObserver(name string, callback Float64ObserverFunc, oos ...InstrumentOption) Float64UpDownSumObserver

NewFloat64UpDownSumObserver calls `Meter.NewFloat64UpDownSumObserver` and returns the instrument, panicking if it encounters an error.

func (MeterMust) NewFloat64ValueObserver Uses

func (mm MeterMust) NewFloat64ValueObserver(name string, callback Float64ObserverFunc, oos ...InstrumentOption) Float64ValueObserver

NewFloat64ValueObserver calls `Meter.NewFloat64ValueObserver` and returns the instrument, panicking if it encounters an error.

func (MeterMust) NewFloat64ValueRecorder Uses

func (mm MeterMust) NewFloat64ValueRecorder(name string, mos ...InstrumentOption) Float64ValueRecorder

NewFloat64ValueRecorder calls `Meter.NewFloat64ValueRecorder` and returns the instrument, panicking if it encounters an error.

func (MeterMust) NewInt64Counter Uses

func (mm MeterMust) NewInt64Counter(name string, cos ...InstrumentOption) Int64Counter

NewInt64Counter calls `Meter.NewInt64Counter` and returns the instrument, panicking if it encounters an error.

func (MeterMust) NewInt64SumObserver Uses

func (mm MeterMust) NewInt64SumObserver(name string, callback Int64ObserverFunc, oos ...InstrumentOption) Int64SumObserver

NewInt64SumObserver calls `Meter.NewInt64SumObserver` and returns the instrument, panicking if it encounters an error.

func (MeterMust) NewInt64UpDownCounter Uses

func (mm MeterMust) NewInt64UpDownCounter(name string, cos ...InstrumentOption) Int64UpDownCounter

NewInt64UpDownCounter calls `Meter.NewInt64UpDownCounter` and returns the instrument, panicking if it encounters an error.

func (MeterMust) NewInt64UpDownSumObserver Uses

func (mm MeterMust) NewInt64UpDownSumObserver(name string, callback Int64ObserverFunc, oos ...InstrumentOption) Int64UpDownSumObserver

NewInt64UpDownSumObserver calls `Meter.NewInt64UpDownSumObserver` and returns the instrument, panicking if it encounters an error.

func (MeterMust) NewInt64ValueObserver Uses

func (mm MeterMust) NewInt64ValueObserver(name string, callback Int64ObserverFunc, oos ...InstrumentOption) Int64ValueObserver

NewInt64ValueObserver calls `Meter.NewInt64ValueObserver` and returns the instrument, panicking if it encounters an error.

func (MeterMust) NewInt64ValueRecorder Uses

func (mm MeterMust) NewInt64ValueRecorder(name string, mos ...InstrumentOption) Int64ValueRecorder

NewInt64ValueRecorder calls `Meter.NewInt64ValueRecorder` and returns the instrument, panicking if it encounters an error.

type MeterOption Uses

type MeterOption interface {
    // ApplyMeter is used to set a MeterOption value of a MeterConfig.
    ApplyMeter(*MeterConfig)
}

MeterOption is an interface for applying Meter options.

type MeterProvider Uses

type MeterProvider interface {
    // Meter creates an implementation of the Meter interface.
    // The instrumentationName must be the name of the library providing
    // instrumentation. This name may be the same as the instrumented code
    // only if that code provides built-in instrumentation. If the
    // instrumentationName is empty, then a implementation defined default
    // name will be used instead.
    Meter(instrumentationName string, opts ...MeterOption) Meter
}

MeterProvider supports named Meter instances.

type NoopAsync Uses

type NoopAsync struct {
    // contains filtered or unexported fields
}

func (NoopAsync) Descriptor Uses

func (NoopAsync) Descriptor() Descriptor

func (NoopAsync) Implementation Uses

func (NoopAsync) Implementation() interface{}

type NoopMeterProvider Uses

type NoopMeterProvider struct{}

func (NoopMeterProvider) Meter Uses

func (NoopMeterProvider) Meter(_ string, _ ...MeterOption) Meter

type NoopSync Uses

type NoopSync struct {
    // contains filtered or unexported fields
}

func (NoopSync) Bind Uses

func (NoopSync) Bind([]label.KeyValue) BoundSyncImpl

func (NoopSync) Descriptor Uses

func (NoopSync) Descriptor() Descriptor

func (NoopSync) Implementation Uses

func (NoopSync) Implementation() interface{}

func (NoopSync) RecordOne Uses

func (NoopSync) RecordOne(context.Context, Number, []label.KeyValue)

type Number Uses

type Number uint64

Number represents either an integral or a floating point value. It needs to be accompanied with a source of NumberKind that describes the actual type of the value stored within Number.

func NewFloat64Number Uses

func NewFloat64Number(f float64) Number

NewFloat64Number creates a floating point Number.

func NewInt64Number Uses

func NewInt64Number(i int64) Number

NewInt64Number creates an integral Number.

func NewNumberFromRaw Uses

func NewNumberFromRaw(r uint64) Number

NewNumberFromRaw creates a new Number from a raw value.

func NewNumberSignChange Uses

func NewNumberSignChange(kind NumberKind, nn Number) Number

NewNumberSignChange returns a number with the same magnitude and the opposite sign. `kind` must describe the kind of number in `nn`.

Does not change Uint64NumberKind values.

func (*Number) AddFloat64 Uses

func (n *Number) AddFloat64(f float64)

AddFloat64 assumes that the number contains a float64 and adds the passed float64 to it.

func (*Number) AddFloat64Atomic Uses

func (n *Number) AddFloat64Atomic(f float64)

AddFloat64Atomic assumes that the number contains a float64 and adds the passed float64 to it atomically.

func (*Number) AddInt64 Uses

func (n *Number) AddInt64(i int64)

AddInt64 assumes that the number contains an int64 and adds the passed int64 to it.

func (*Number) AddInt64Atomic Uses

func (n *Number) AddInt64Atomic(i int64)

AddInt64Atomic assumes that the number contains an int64 and adds the passed int64 to it atomically.

func (*Number) AddNumber Uses

func (n *Number) AddNumber(kind NumberKind, nn Number)

AddNumber assumes that this and the passed number are of the passed kind and adds the passed number to this number.

func (*Number) AddNumberAtomic Uses

func (n *Number) AddNumberAtomic(kind NumberKind, nn Number)

AddNumberAtomic assumes that this and the passed number are of the passed kind and adds the passed number to this number atomically.

func (*Number) AddRaw Uses

func (n *Number) AddRaw(kind NumberKind, r uint64)

AddRaw assumes that this number and the passed raw value are of the passed kind and adds the passed raw value to this number.

func (*Number) AddRawAtomic Uses

func (n *Number) AddRawAtomic(kind NumberKind, r uint64)

AddRawAtomic assumes that this number and the passed raw value are of the passed kind and adds the passed raw value to this number atomically.

func (*Number) AsFloat64 Uses

func (n *Number) AsFloat64() float64

AsFloat64 assumes that the measurement value contains a float64 and returns it as such.

func (*Number) AsFloat64Atomic Uses

func (n *Number) AsFloat64Atomic() float64

AsFloat64Atomic assumes that the measurement value contains a float64 and returns it as such atomically.

func (*Number) AsFloat64Ptr Uses

func (n *Number) AsFloat64Ptr() *float64

AsFloat64Ptr assumes that the number contains a float64 and returns a pointer to it.

func (*Number) AsInt64 Uses

func (n *Number) AsInt64() int64

AsInt64 assumes that the value contains an int64 and returns it as such.

func (*Number) AsInt64Atomic Uses

func (n *Number) AsInt64Atomic() int64

AsInt64Atomic assumes that the number contains an int64 and returns it as such atomically.

func (*Number) AsInt64Ptr Uses

func (n *Number) AsInt64Ptr() *int64

AsInt64Ptr assumes that the number contains an int64 and returns a pointer to it.

func (*Number) AsInterface Uses

func (n *Number) AsInterface(kind NumberKind) interface{}

AsInterface returns the number as an interface{}, typically used for NumberKind-correct JSON conversion.

func (*Number) AsNumber Uses

func (n *Number) AsNumber() Number

AsNumber gets the Number.

func (*Number) AsNumberAtomic Uses

func (n *Number) AsNumberAtomic() Number

AsNumberAtomic gets the Number atomically.

func (*Number) AsRaw Uses

func (n *Number) AsRaw() uint64

AsRaw gets the uninterpreted raw value. Might be useful for some atomic operations.

func (*Number) AsRawAtomic Uses

func (n *Number) AsRawAtomic() uint64

AsRawAtomic gets the uninterpreted raw value atomically. Might be useful for some atomic operations.

func (*Number) AsRawPtr Uses

func (n *Number) AsRawPtr() *uint64

AsRawPtr gets the pointer to the raw, uninterpreted raw value. Might be useful for some atomic operations.

func (*Number) CoerceToFloat64 Uses

func (n *Number) CoerceToFloat64(kind NumberKind) float64

CoerceToFloat64 casts the number to float64. May result in data/precision loss.

func (*Number) CoerceToInt64 Uses

func (n *Number) CoerceToInt64(kind NumberKind) int64

CoerceToInt64 casts the number to int64. May result in data/precision loss.

func (*Number) CompareAndSwapFloat64 Uses

func (n *Number) CompareAndSwapFloat64(of, nf float64) bool

CompareAndSwapFloat64 assumes that this number contains a float64 and does the atomic CAS operation on it.

func (*Number) CompareAndSwapInt64 Uses

func (n *Number) CompareAndSwapInt64(oi, ni int64) bool

CompareAndSwapInt64 assumes that this number contains an int64 and does the atomic CAS operation on it.

func (*Number) CompareAndSwapNumber Uses

func (n *Number) CompareAndSwapNumber(on, nn Number) bool

CompareAndSwapNumber does the atomic CAS operation on this number. This number and passed old and new numbers should be of the same kind.

func (*Number) CompareAndSwapRaw Uses

func (n *Number) CompareAndSwapRaw(or, nr uint64) bool

CompareAndSwapRaw does the atomic CAS operation on this number. This number and passed old and new raw values should be of the same kind.

func (*Number) CompareFloat64 Uses

func (n *Number) CompareFloat64(f float64) int

CompareFloat64 assumes that the Number contains a float64 and performs a comparison between the value and the other value. It returns the typical result of the compare function: -1 if the value is less than the other, 0 if both are equal, 1 if the value is greater than the other.

Do not compare NaN values.

func (*Number) CompareInt64 Uses

func (n *Number) CompareInt64(i int64) int

CompareInt64 assumes that the Number contains an int64 and performs a comparison between the value and the other value. It returns the typical result of the compare function: -1 if the value is less than the other, 0 if both are equal, 1 if the value is greater than the other.

func (*Number) CompareNumber Uses

func (n *Number) CompareNumber(kind NumberKind, nn Number) int

CompareNumber compares two Numbers given their kind. Both numbers should have the same kind. This returns:

0 if the numbers are equal
-1 if the subject `n` is less than the argument `nn`
+1 if the subject `n` is greater than the argument `nn`

func (*Number) CompareRaw Uses

func (n *Number) CompareRaw(kind NumberKind, r uint64) int

CompareRaw compares two numbers, where one is input as a raw uint64, interpreting both values as a `kind` of number.

func (*Number) Emit Uses

func (n *Number) Emit(kind NumberKind) string

Emit returns a string representation of the raw value of the Number. A %d is used for integral values, %f for floating point values.

func (*Number) IsNegative Uses

func (n *Number) IsNegative(kind NumberKind) bool

IsNegative returns true if the actual value is less than zero.

func (*Number) IsPositive Uses

func (n *Number) IsPositive(kind NumberKind) bool

IsPositive returns true if the actual value is greater than zero.

func (*Number) IsZero Uses

func (n *Number) IsZero(kind NumberKind) bool

IsZero returns true if the actual value is equal to zero.

func (*Number) SetFloat64 Uses

func (n *Number) SetFloat64(f float64)

SetFloat64 assumes that the number contains a float64 and sets it to the passed value.

func (*Number) SetFloat64Atomic Uses

func (n *Number) SetFloat64Atomic(f float64)

SetFloat64Atomic assumes that the number contains a float64 and sets it to the passed value atomically.

func (*Number) SetInt64 Uses

func (n *Number) SetInt64(i int64)

SetInt64 assumes that the number contains an int64 and sets it to the passed value.

func (*Number) SetInt64Atomic Uses

func (n *Number) SetInt64Atomic(i int64)

SetInt64Atomic assumes that the number contains an int64 and sets it to the passed value atomically.

func (*Number) SetNumber Uses

func (n *Number) SetNumber(nn Number)

SetNumber sets the number to the passed number. Both should be of the same kind.

func (*Number) SetNumberAtomic Uses

func (n *Number) SetNumberAtomic(nn Number)

SetNumberAtomic sets the number to the passed number atomically. Both should be of the same kind.

func (*Number) SetRaw Uses

func (n *Number) SetRaw(r uint64)

SetRaw sets the number to the passed raw value. Both number and the raw number should represent the same kind.

func (*Number) SetRawAtomic Uses

func (n *Number) SetRawAtomic(r uint64)

SetRawAtomic sets the number to the passed raw value atomically. Both number and the raw number should represent the same kind.

func (*Number) SwapFloat64 Uses

func (n *Number) SwapFloat64(f float64) float64

SwapFloat64 assumes that the number contains an float64, sets it to the passed value and returns the old float64 value.

func (*Number) SwapFloat64Atomic Uses

func (n *Number) SwapFloat64Atomic(f float64) float64

SwapFloat64Atomic assumes that the number contains an float64, sets it to the passed value and returns the old float64 value atomically.

func (*Number) SwapInt64 Uses

func (n *Number) SwapInt64(i int64) int64

SwapInt64 assumes that the number contains an int64, sets it to the passed value and returns the old int64 value.

func (*Number) SwapInt64Atomic Uses

func (n *Number) SwapInt64Atomic(i int64) int64

SwapInt64Atomic assumes that the number contains an int64, sets it to the passed value and returns the old int64 value atomically.

func (*Number) SwapNumber Uses

func (n *Number) SwapNumber(nn Number) Number

SwapNumber sets the number to the passed number and returns the old number. Both this number and the passed number should be of the same kind.

func (*Number) SwapNumberAtomic Uses

func (n *Number) SwapNumberAtomic(nn Number) Number

SwapNumberAtomic sets the number to the passed number and returns the old number atomically. Both this number and the passed number should be of the same kind.

func (*Number) SwapRaw Uses

func (n *Number) SwapRaw(r uint64) uint64

SwapRaw sets the number to the passed raw value and returns the old raw value. Both number and the raw number should represent the same kind.

func (*Number) SwapRawAtomic Uses

func (n *Number) SwapRawAtomic(r uint64) uint64

SwapRawAtomic sets the number to the passed raw value and returns the old raw value atomically. Both number and the raw number should represent the same kind.

type NumberKind Uses

type NumberKind int8

NumberKind describes the data type of the Number.

const (
    // Int64NumberKind means that the Number stores int64.
    Int64NumberKind NumberKind = iota
    // Float64NumberKind means that the Number stores float64.
    Float64NumberKind
)

func (NumberKind) Maximum Uses

func (k NumberKind) Maximum() Number

Maximum returns the maximum representable value for a given NumberKind

func (NumberKind) Minimum Uses

func (k NumberKind) Minimum() Number

Minimum returns the minimum representable value for a given NumberKind

func (NumberKind) String Uses

func (i NumberKind) String() string

func (NumberKind) Zero Uses

func (k NumberKind) Zero() Number

Zero returns a zero value for a given NumberKind

type Observation Uses

type Observation struct {
    // contains filtered or unexported fields
}

Observation is used for reporting an asynchronous batch of metric values. Instances of this type should be created by asynchronous instruments (e.g., Int64ValueObserver.Observation()).

func (Observation) AsyncImpl Uses

func (m Observation) AsyncImpl() AsyncImpl

AsyncImpl returns the instrument that created this observation. This returns an implementation-level object for use by the SDK, users should not refer to this.

func (Observation) Number Uses

func (m Observation) Number() Number

Number returns a number recorded in this observation.

type Span Uses

type Span interface {
    // Tracer returns the Tracer that created the Span. Tracer MUST NOT be
    // nil.
    Tracer() Tracer

    // End completes the Span. Updates are not allowed the Span after End is
    // called other than setting the status.
    End(options ...SpanOption)

    // AddEvent adds an event with the provided name and options.
    AddEvent(name string, options ...EventOption)

    // IsRecording returns the recording state of the Span. It will return
    // true if the Span is active and events can be recorded.
    IsRecording() bool

    // RecordError records an error as a Span event.
    RecordError(err error, options ...EventOption)

    // SpanContext returns the SpanContext of the Span. The returned
    // SpanContext is usable even after the End has been called for the Span.
    SpanContext() SpanContext

    // SetStatus sets the status of the Span in the form of a code and a
    // message. SetStatus overrides the value of previous calls to SetStatus
    // on the Span.
    SetStatus(code codes.Code, msg string)

    // SetName sets the Span name.
    SetName(name string)

    // SetAttributes sets kv as attributes of the Span. If a key from kv
    // already exists for an attribute of the Span it will be overwritten with
    // the value contained in kv.
    SetAttributes(kv ...label.KeyValue)
}

Span is the individual component of a trace. It represents a single named and timed operation of a workflow that is traced. A Tracer is used to create a Span and it is then up to the operation the Span represents to properly end the Span when the operation itself ends.

func SpanFromContext Uses

func SpanFromContext(ctx context.Context) Span

SpanFromContext returns the current span from ctx, or nil if none set.

type SpanConfig Uses

type SpanConfig struct {
    // Attributes describe the associated qualities of a Span.
    Attributes []label.KeyValue
    // Timestamp is a time in a Span life-cycle.
    Timestamp time.Time
    // Links are the associations a Span has with other Spans.
    Links []Link
    // Record is the recording state of a Span.
    Record bool
    // NewRoot identifies a Span as the root Span for a new trace. This is
    // commonly used when an existing trace crosses trust boundaries and the
    // remote parent span context should be ignored for security.
    NewRoot bool
    // SpanKind is the role a Span has in a trace.
    SpanKind SpanKind
}

SpanConfig is a group of options for a Span.

func NewEventConfig Uses

func NewEventConfig(options ...EventOption) *SpanConfig

NewEventConfig applies all the EventOptions to a returned SpanConfig. If no timestamp option is passed, the returned SpanConfig will have a Timestamp set to the call time, otherwise no validation is performed on the returned SpanConfig.

func NewSpanConfig Uses

func NewSpanConfig(options ...SpanOption) *SpanConfig

NewSpanConfig applies all the options to a returned SpanConfig. No validation is performed on the returned SpanConfig (e.g. no uniqueness checking or bounding of data), it is left to the SDK to perform this action.

type SpanContext Uses

type SpanContext struct {
    TraceID    TraceID
    SpanID     SpanID
    TraceFlags byte
}

SpanContext contains identifying trace information about a Span.

func RemoteSpanContextFromContext Uses

func RemoteSpanContextFromContext(ctx context.Context) SpanContext

RemoteSpanContextFromContext returns the remote span context from ctx.

func (SpanContext) HasSpanID Uses

func (sc SpanContext) HasSpanID() bool

HasSpanID checks if the SpanContext has a valid SpanID.

func (SpanContext) HasTraceID Uses

func (sc SpanContext) HasTraceID() bool

HasTraceID checks if the SpanContext has a valid TraceID.

func (SpanContext) IsDebug Uses

func (sc SpanContext) IsDebug() bool

IsDebug returns if the debug bit is set in the trace flags.

func (SpanContext) IsDeferred Uses

func (sc SpanContext) IsDeferred() bool

IsDeferred returns if the deferred bit is set in the trace flags.

func (SpanContext) IsSampled Uses

func (sc SpanContext) IsSampled() bool

IsSampled returns if the sampling bit is set in the trace flags.

func (SpanContext) IsValid Uses

func (sc SpanContext) IsValid() bool

IsValid returns if the SpanContext is valid. A valid span context has a valid TraceID and SpanID.

type SpanID Uses

type SpanID [8]byte

SpanID is a unique identity of a span in a trace.

func SpanIDFromHex Uses

func SpanIDFromHex(h string) (SpanID, error)

SpanIDFromHex returns a SpanID from a hex string if it is compliant with the w3c trace-context specification. See more at https://www.w3.org/TR/trace-context/#parent-id

func (SpanID) IsValid Uses

func (s SpanID) IsValid() bool

IsValid checks whether the SpanID is valid. A valid SpanID does not consist of zeros only.

func (SpanID) MarshalJSON Uses

func (s SpanID) MarshalJSON() ([]byte, error)

MarshalJSON implements a custom marshal function to encode SpanID as a hex string.

func (SpanID) String Uses

func (s SpanID) String() string

String returns the hex string representation form of a SpanID

type SpanKind Uses

type SpanKind int

SpanKind is the role a Span plays in a Trace.

const (
    // SpanKindUnspecified is an unspecified SpanKind and is not a valid
    // SpanKind. SpanKindUnspecified should be replaced with SpanKindInternal
    // if it is received.
    SpanKindUnspecified SpanKind = 0
    // SpanKindInternal is a SpanKind for a Span that represents an internal
    // operation within an application.
    SpanKindInternal SpanKind = 1
    // SpanKindServer is a SpanKind for a Span that represents the operation
    // of handling a request from a client.
    SpanKindServer SpanKind = 2
    // SpanKindClient is a SpanKind for a Span that represents the operation
    // of client making a request to a server.
    SpanKindClient SpanKind = 3
    // SpanKindProducer is a SpanKind for a Span that represents the operation
    // of a producer sending a message to a message broker. Unlike
    // SpanKindClient and SpanKindServer, there is often no direct
    // relationship between this kind of Span and a SpanKindConsumer kind. A
    // SpanKindProducer Span will end once the message is accepted by the
    // message broker which might not overlap with the processing of that
    // message.
    SpanKindProducer SpanKind = 4
    // SpanKindConsumer is a SpanKind for a Span that represents the operation
    // of a consumer receiving a message from a message broker. Like
    // SpanKindProducer Spans, there is often no direct relationship between
    // this Span and the Span that produced the message.
    SpanKindConsumer SpanKind = 5
)

As a convenience, these match the proto definition, see https://github.com/open-telemetry/opentelemetry-proto/blob/30d237e1ff3ab7aa50e0922b5bebdd93505090af/opentelemetry/proto/trace/v1/trace.proto#L101-L129

The unspecified value is not a valid `SpanKind`. Use `ValidateSpanKind()` to coerce a span kind to a valid value.

func ValidateSpanKind Uses

func ValidateSpanKind(spanKind SpanKind) SpanKind

ValidateSpanKind returns a valid span kind value. This will coerce invalid values into the default value, SpanKindInternal.

func (SpanKind) String Uses

func (sk SpanKind) String() string

String returns the specified name of the SpanKind in lower-case.

type SpanOption Uses

type SpanOption interface {
    ApplySpan(*SpanConfig)
}

SpanOption applies an option to a SpanConfig.

func WithLinks(links ...Link) SpanOption

WithLinks adds links to a Span. The links are added to the existing Span links, i.e. this does not overwrite.

func WithNewRoot Uses

func WithNewRoot() SpanOption

WithNewRoot specifies that the Span should be treated as a root Span. Any existing parent span context will be ignored when defining the Span's trace identifiers.

func WithRecord Uses

func WithRecord() SpanOption

WithRecord specifies that the span should be recorded. It is important to note that implementations may override this option, i.e. if the span is a child of an un-sampled trace.

func WithSpanKind Uses

func WithSpanKind(kind SpanKind) SpanOption

WithSpanKind sets the SpanKind of a Span.

type SyncImpl Uses

type SyncImpl interface {
    InstrumentImpl

    // Bind creates an implementation-level bound instrument,
    // binding a label set with this instrument implementation.
    Bind(labels []label.KeyValue) BoundSyncImpl

    // RecordOne captures a single synchronous metric event.
    RecordOne(ctx context.Context, number Number, labels []label.KeyValue)
}

SyncImpl is the implementation-level interface to a generic synchronous instrument (e.g., ValueRecorder and Counter instruments).

type TextMapCarrier Uses

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 Uses

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 Uses

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 TraceID Uses

type TraceID [16]byte

TraceID is a unique identity of a trace.

func TraceIDFromHex Uses

func TraceIDFromHex(h string) (TraceID, error)

TraceIDFromHex returns a TraceID from a hex string if it is compliant with the W3C trace-context specification. See more at https://www.w3.org/TR/trace-context/#trace-id

func (TraceID) IsValid Uses

func (t TraceID) IsValid() bool

IsValid checks whether the trace TraceID is valid. A valid trace ID does not consist of zeros only.

func (TraceID) MarshalJSON Uses

func (t TraceID) MarshalJSON() ([]byte, error)

MarshalJSON implements a custom marshal function to encode TraceID as a hex string.

func (TraceID) String Uses

func (t TraceID) String() string

String returns the hex string representation form of a TraceID

type Tracer Uses

type Tracer interface {
    // Start creates a span.
    Start(ctx context.Context, spanName string, opts ...SpanOption) (context.Context, Span)
}

Tracer is the creator of Spans.

type TracerConfig Uses

type TracerConfig struct {
    // InstrumentationVersion is the version of the library providing
    // instrumentation.
    InstrumentationVersion string
}

TracerConfig is a group of options for a Tracer.

func NewTracerConfig Uses

func NewTracerConfig(options ...TracerOption) *TracerConfig

NewTracerConfig applies all the options to a returned TracerConfig.

type TracerOption Uses

type TracerOption interface {
    ApplyTracer(*TracerConfig)
}

TracerOption applies an option to a TracerConfig.

type TracerProvider Uses

type TracerProvider interface {
    // Tracer creates an implementation of the Tracer interface.
    // The instrumentationName must be the name of the library providing
    // instrumentation. This name may be the same as the instrumented code
    // only if that code provides built-in instrumentation. If the
    // instrumentationName is empty, then a implementation defined default
    // name will be used instead.
    Tracer(instrumentationName string, opts ...TracerOption) Tracer
}

TracerProvider provides access to instrumentation Tracers.

func NewNoopTracerProvider Uses

func NewNoopTracerProvider() TracerProvider

NewNoopTracerProvider returns an implementation of TracerProvider that performs no operations. The Tracer and Spans created from the returned TracerProvider also perform no operations.

Directories

PathSynopsis
api/apitest
api/global/internal
api/metric/metrictestPackage metrictest contains utilities for testing metrics.
bridge/opentracingThis package implements a bridge that forwards OpenTracing API calls to the OpenTelemetry SDK.
bridge/opentracing/internal
bridge/opentracing/migrationThis package provides interfaces and functions that are useful for providing a cooperation of the OpenTelemetry tracers with the OpenTracing API.
codesPackage codes defines the canonical error codes used by OpenTelemetry.
example/basic
example/jaegerCommand jaeger is an example program that creates spans and uploads to Jaeger.
example/namedtracer
example/namedtracer/foo
example/otel-collectorExample using the OTLP exporter + collector + third-party backends.
example/prometheus
example/zipkinCommand zipkin is an example program that creates spans and uploads to openzipkin collector.
exporters/metric/prometheus
exporters/otlpPackage otlp contains an exporter for the OpenTelemetry protocol buffers.
exporters/otlp/internal/opentelemetry-proto-gen/collector/metrics/v1
exporters/otlp/internal/opentelemetry-proto-gen/collector/trace/v1
exporters/otlp/internal/opentelemetry-proto-gen/common/v1
exporters/otlp/internal/opentelemetry-proto-gen/metrics/v1
exporters/otlp/internal/opentelemetry-proto-gen/resource/v1
exporters/otlp/internal/opentelemetry-proto-gen/trace/v1
exporters/otlp/internal/transformPackage transform provides translations for opentelemetry-go concepts and structures to otlp structures.
exporters/stdoutPackage stdout contains an OpenTelemetry exporter for both tracing and metric telemetry to be written to an output destination as JSON.
exporters/trace/jaegerPackage jaeger contains an OpenTelemetry tracing exporter for Jaeger.
exporters/trace/jaeger/internal/gen-go/jaeger
exporters/trace/jaeger/internal/gen-go/jaeger/collector-remote
exporters/trace/zipkinPackage zipkin contains an OpenTelemetry tracing exporter for Zipkin.
globalPackage global provides global providers, propagators and more.
global/internal
internal
internal/baggagePackage baggage provides types and functions to manage W3C Baggage.
internal/matchers
internal/metric
internal/testing
internal/trace/noopPackage noop provides noop tracing implementations for tracer and span.
internal/trace/parent
labelPackage label provides key and value labels.
oteltestPackage oteltest provides testing utilities for the otel package.
propagatorsPackage propagators contains OpenTelemetry context propagators.
registry
sdkPackage opentelemetry contains Go support for OpenTelemetry.
sdk/export/metric
sdk/export/metric/aggregation
sdk/export/metric/metrictest
sdk/export/trace
sdk/export/trace/tracetesttracetest is a testing helper package for the SDK.
sdk/instrumentationPackage instrumentation provides an instrumentation library structure to be passed to both the OpenTelemetry Tracer and Meter components.
sdk/internal
sdk/metricPackage metric implements the OpenTelemetry metric.MeterImpl interface.
sdk/metric/aggregator
sdk/metric/aggregator/aggregatortest
sdk/metric/aggregator/array
sdk/metric/aggregator/ddsketch
sdk/metric/aggregator/histogram
sdk/metric/aggregator/lastvalue
sdk/metric/aggregator/minmaxsumcount
sdk/metric/aggregator/sum
sdk/metric/controller/controllertest
sdk/metric/controller/pull
sdk/metric/controller/push
sdk/metric/controller/time
sdk/metric/processor/basic
sdk/metric/processor/processortest
sdk/metric/processor/reducerPackage reducer implements a metrics Processor component that applies a `label.Filter` to each processed `export.Accumulation` to remove labels before passing the result to another Processor.
sdk/metric/selector/simple
sdk/resourcePackage resource provides detecting and representing resources.
sdk/tracePackage trace contains support for OpenTelemetry distributed tracing.
sdk/trace/internalPackage internal provides trace internals.
semconvPackage semconv implements OpenTelemetry semantic conventions.
unitPackage unit provides units.

Package otel imports 15 packages (graph) and is imported by 37 packages. Updated 2020-10-18. Refresh now. Tools for package owners.