package asyncint64

import "go.opentelemetry.io/otel/metric/instrument/asyncint64"

Index

Types

type Counter

type Counter interface {
	// Observe records the state of the instrument.
	//
	// It is only valid to call this within a callback. If called outside of the
	// registered callback it should have no effect on the instrument, and an
	// error will be reported via the error handler.
	Observe(ctx context.Context, x int64, attrs ...attribute.KeyValue)

	instrument.Asynchronous
}

Counter is an instrument that records increasing values.

type Gauge

type Gauge interface {
	// Observe records the state of the instrument.
	//
	// It is only valid to call this within a callback. If called outside of the
	// registered callback it should have no effect on the instrument, and an
	// error will be reported via the error handler.
	Observe(ctx context.Context, x int64, attrs ...attribute.KeyValue)

	instrument.Asynchronous
}

Gauge is an instrument that records independent readings.

type InstrumentProvider

type InstrumentProvider interface {
	// Counter creates an instrument for recording increasing values.
	Counter(name string, opts ...instrument.Option) (Counter, error)

	// UpDownCounter creates an instrument for recording changes of a value.
	UpDownCounter(name string, opts ...instrument.Option) (UpDownCounter, error)

	// Gauge creates an instrument for recording the current value.
	Gauge(name string, opts ...instrument.Option) (Gauge, error)
}

InstrumentProvider provides access to individual instruments.

type UpDownCounter

type UpDownCounter interface {
	// Observe records the state of the instrument.
	//
	// It is only valid to call this within a callback. If called outside of the
	// registered callback it should have no effect on the instrument, and an
	// error will be reported via the error handler.
	Observe(ctx context.Context, x int64, attrs ...attribute.KeyValue)

	instrument.Asynchronous
}

UpDownCounter is an instrument that records increasing or decreasing values.

Source Files

asyncint64.go

Version
v0.31.0
Published
Jul 8, 2022
Platform
linux/amd64
Imports
3 packages
Last checked
2 hours ago

Tools for package owners.