instrument

package
v0.35.0 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Asynchronous

type Asynchronous interface {
	// contains filtered or unexported methods
}

Asynchronous instruments are instruments that are updated within a Callback. If an instrument is observed outside of it's callback it should be an error.

This interface is used as a grouping mechanism.

type Float64Callback added in v0.35.0

type Float64Callback func(context.Context, Float64Observer) error

Float64Callback is a function registered with a Meter that makes observations for a Float64Observerable instrument it is registered with. Calls to the Float64Observer record measurement values for the Float64Observable.

The function needs to complete in a finite amount of time and the deadline of the passed context is expected to be honored.

The function needs to make unique observations across all registered Float64Callbacks. Meaning, it should not report measurements with the same attributes as another Float64Callbacks also registered for the same instrument.

The function needs to be concurrent safe.

type Float64Config added in v0.35.0

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

Float64Config contains options for Asynchronous instruments that observe float64 values.

func NewFloat64Config added in v0.35.0

func NewFloat64Config(opts ...Float64Option) Float64Config

Float64Config contains options for Synchronous instruments that record float64 values.

func (Float64Config) Description added in v0.35.0

func (c Float64Config) Description() string

Description returns the Config description.

func (Float64Config) Unit added in v0.35.0

func (c Float64Config) Unit() unit.Unit

Unit returns the Config unit.

type Float64Counter added in v0.35.0

type Float64Counter interface {
	// Add records a change to the counter.
	Add(ctx context.Context, incr float64, attrs ...attribute.KeyValue)

	Synchronous
}

Float64Counter is an instrument that records increasing float64 values.

Warning: methods may be added to this interface in minor releases.

type Float64Histogram added in v0.35.0

type Float64Histogram interface {
	// Record adds an additional value to the distribution.
	Record(ctx context.Context, incr float64, attrs ...attribute.KeyValue)

	Synchronous
}

Float64Histogram is an instrument that records a distribution of float64 values.

Warning: methods may be added to this interface in minor releases.

type Float64Observable added in v0.35.0

type Float64Observable interface {
	Asynchronous
	// contains filtered or unexported methods
}

Float64Observable describes a set of instruments used asynchronously to record float64 measurements once per collection cycle. Observations of these instruments are only made within a callback.

Warning: methods may be added to this interface in minor releases.

type Float64ObservableCounter added in v0.35.0

type Float64ObservableCounter interface{ Float64Observable }

Float64ObservableCounter is an instrument used to asynchronously record increasing float64 measurements once per collection cycle. Observations are only made within a callback for this instrument. The value observed is assumed the to be the cumulative sum of the count.

Warning: methods may be added to this interface in minor releases.

type Float64ObservableGauge added in v0.35.0

type Float64ObservableGauge interface{ Float64Observable }

Float64ObservableGauge is an instrument used to asynchronously record instantaneous float64 measurements once per collection cycle. Observations are only made within a callback for this instrument.

Warning: methods may be added to this interface in minor releases.

type Float64ObservableUpDownCounter added in v0.35.0

type Float64ObservableUpDownCounter interface{ Float64Observable }

Float64ObservableUpDownCounter is an instrument used to asynchronously record float64 measurements once per collection cycle. Observations are only made within a callback for this instrument. The value observed is assumed the to be the cumulative sum of the count.

Warning: methods may be added to this interface in minor releases.

type Float64Observer added in v0.35.0

type Float64Observer interface {
	Observe(value float64, attributes ...attribute.KeyValue)
}

Float64Observer is a recorder of float64 measurements.

Warning: methods may be added to this interface in minor releases.

type Float64ObserverConfig added in v0.35.0

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

Float64ObserverConfig contains options for Asynchronous instruments that observe float64 values.

func NewFloat64ObserverConfig added in v0.35.0

func NewFloat64ObserverConfig(opts ...Float64ObserverOption) Float64ObserverConfig

NewFloat64ObserverConfig returns a new Float64ObserverConfig with all opts applied.

func (Float64ObserverConfig) Callbacks added in v0.35.0

func (c Float64ObserverConfig) Callbacks() []Float64Callback

Callbacks returns the Config callbacks.

func (Float64ObserverConfig) Description added in v0.35.0

func (c Float64ObserverConfig) Description() string

Description returns the Config description.

func (Float64ObserverConfig) Unit added in v0.35.0

func (c Float64ObserverConfig) Unit() unit.Unit

Unit returns the Config unit.

type Float64ObserverOption added in v0.35.0

type Float64ObserverOption interface {
	// contains filtered or unexported methods
}

Float64ObserverOption applies options to float64 Observer instruments.

func WithFloat64Callback added in v0.35.0

func WithFloat64Callback(callback Float64Callback) Float64ObserverOption

WithFloat64Callback adds callback to be called for an instrument.

type Float64Option added in v0.35.0

type Float64Option interface {
	// contains filtered or unexported methods
}

Float64Option applies options to synchronous float64 instruments.

type Float64UpDownCounter added in v0.35.0

type Float64UpDownCounter interface {
	// Add records a change to the counter.
	Add(ctx context.Context, incr float64, attrs ...attribute.KeyValue)

	Synchronous
}

Float64UpDownCounter is an instrument that records increasing or decreasing float64 values.

Warning: methods may be added to this interface in minor releases.

type Int64Callback added in v0.35.0

type Int64Callback func(context.Context, Int64Observer) error

Int64Callback is a function registered with a Meter that makes observations for a Int64Observerable instrument it is registered with. Calls to the Int64Observer record measurement values for the Int64Observable.

The function needs to complete in a finite amount of time and the deadline of the passed context is expected to be honored.

The function needs to make unique observations across all registered Int64Callback. Meaning, it should not report measurements with the same attributes as another Int64Callbacks also registered for the same instrument.

The function needs to be concurrent safe.

type Int64Config added in v0.35.0

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

Int64Config contains options for Synchronous instruments that record int64 values.

func NewInt64Config added in v0.35.0

func NewInt64Config(opts ...Int64Option) Int64Config

NewInt64Config returns a new Int64Config with all opts applied.

func (Int64Config) Description added in v0.35.0

func (c Int64Config) Description() string

Description returns the Config description.

func (Int64Config) Unit added in v0.35.0

func (c Int64Config) Unit() unit.Unit

Unit returns the Config unit.

type Int64Counter added in v0.35.0

type Int64Counter interface {
	// Add records a change to the counter.
	Add(ctx context.Context, incr int64, attrs ...attribute.KeyValue)

	Synchronous
}

Int64Counter is an instrument that records increasing int64 values.

Warning: methods may be added to this interface in minor releases.

type Int64Histogram added in v0.35.0

type Int64Histogram interface {
	// Record adds an additional value to the distribution.
	Record(ctx context.Context, incr int64, attrs ...attribute.KeyValue)

	Synchronous
}

Int64Histogram is an instrument that records a distribution of int64 values.

Warning: methods may be added to this interface in minor releases.

type Int64Observable added in v0.35.0

type Int64Observable interface {
	Asynchronous
	// contains filtered or unexported methods
}

Int64Observable describes a set of instruments used asynchronously to record int64 measurements once per collection cycle. Observations of these instruments are only made within a callback.

Warning: methods may be added to this interface in minor releases.

type Int64ObservableCounter added in v0.35.0

type Int64ObservableCounter interface{ Int64Observable }

Int64ObservableCounter is an instrument used to asynchronously record increasing int64 measurements once per collection cycle. Observations are only made within a callback for this instrument. The value observed is assumed the to be the cumulative sum of the count.

Warning: methods may be added to this interface in minor releases.

type Int64ObservableGauge added in v0.35.0

type Int64ObservableGauge interface{ Int64Observable }

Int64ObservableGauge is an instrument used to asynchronously record instantaneous int64 measurements once per collection cycle. Observations are only made within a callback for this instrument.

Warning: methods may be added to this interface in minor releases.

type Int64ObservableUpDownCounter added in v0.35.0

type Int64ObservableUpDownCounter interface{ Int64Observable }

Int64ObservableUpDownCounter is an instrument used to asynchronously record int64 measurements once per collection cycle. Observations are only made within a callback for this instrument. The value observed is assumed the to be the cumulative sum of the count.

Warning: methods may be added to this interface in minor releases.

type Int64Observer added in v0.35.0

type Int64Observer interface {
	Observe(value int64, attributes ...attribute.KeyValue)
}

Int64Observer is a recorder of int64 measurements.

Warning: methods may be added to this interface in minor releases.

type Int64ObserverConfig added in v0.35.0

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

Int64ObserverConfig contains options for Asynchronous instruments that observe int64 values.

func NewInt64ObserverConfig added in v0.35.0

func NewInt64ObserverConfig(opts ...Int64ObserverOption) Int64ObserverConfig

NewInt64ObserverConfig returns a new Int64ObserverConfig with all opts applied.

func (Int64ObserverConfig) Callbacks added in v0.35.0

func (c Int64ObserverConfig) Callbacks() []Int64Callback

Callbacks returns the Config callbacks.

func (Int64ObserverConfig) Description added in v0.35.0

func (c Int64ObserverConfig) Description() string

Description returns the Config description.

func (Int64ObserverConfig) Unit added in v0.35.0

func (c Int64ObserverConfig) Unit() unit.Unit

Unit returns the Config unit.

type Int64ObserverOption added in v0.35.0

type Int64ObserverOption interface {
	// contains filtered or unexported methods
}

Int64ObserverOption applies options to int64 Observer instruments.

func WithInt64Callback added in v0.35.0

func WithInt64Callback(callback Int64Callback) Int64ObserverOption

WithInt64Callback adds callback to be called for an instrument.

type Int64Option added in v0.35.0

type Int64Option interface {
	// contains filtered or unexported methods
}

Int64Option applies options to synchronous int64 instruments.

type Int64UpDownCounter added in v0.35.0

type Int64UpDownCounter interface {
	// Add records a change to the counter.
	Add(ctx context.Context, incr int64, attrs ...attribute.KeyValue)

	Synchronous
}

Int64UpDownCounter is an instrument that records increasing or decreasing int64 values.

Warning: methods may be added to this interface in minor releases.

type Option

Option applies options to all instruments.

func WithDescription

func WithDescription(desc string) Option

WithDescription sets the instrument description.

func WithUnit

func WithUnit(u unit.Unit) Option

WithUnit sets the instrument unit.

type Synchronous

type Synchronous interface {
	// contains filtered or unexported methods
}

Synchronous instruments are updated in line with application code.

This interface is used as a grouping mechanism.

Directories

Path Synopsis
Package asyncfloat64 provides asynchronous instruments that accept float64 measurments.
Package asyncfloat64 provides asynchronous instruments that accept float64 measurments.
Package asyncint64 provides asynchronous instruments that accept int64 measurments.
Package asyncint64 provides asynchronous instruments that accept int64 measurments.
Package syncfloat64 provides synchronous instruments that accept float64 measurments.
Package syncfloat64 provides synchronous instruments that accept float64 measurments.
Package syncint64 provides synchronous instruments that accept int64 measurments.
Package syncint64 provides synchronous instruments that accept int64 measurments.

Jump to

Keyboard shortcuts

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