otel: go.opentelemetry.io/otel/internal/metric Index | Files

package metric

import "go.opentelemetry.io/otel/internal/metric"


Package Files



var ErrInvalidAsyncRunner = errors.New("unknown async runner type")

type AsyncCollector Uses

type AsyncCollector interface {
    // CollectAsync passes a batch of observations to the MeterImpl.
    CollectAsync(labels []label.KeyValue, observation ...metric.Observation)

AsyncCollector is an interface used between the MeterImpl and the AsyncInstrumentState helper below. This interface is implemented by the SDK to provide support for running observer callbacks.

type AsyncInstrumentState Uses

type AsyncInstrumentState struct {
    // contains filtered or unexported fields

AsyncInstrumentState manages an ordered set of asynchronous instruments and the distinct runners, taking into account batch observer callbacks.

func NewAsyncInstrumentState Uses

func NewAsyncInstrumentState() *AsyncInstrumentState

NewAsyncInstrumentState returns a new *AsyncInstrumentState, for use by MeterImpl to manage running the set of observer callbacks in the correct order.

func (*AsyncInstrumentState) Instruments Uses

func (a *AsyncInstrumentState) Instruments() []metric.AsyncImpl

Instruments returns the asynchronous instruments managed by this object, the set that should be checkpointed after observers are run.

func (*AsyncInstrumentState) Register Uses

func (a *AsyncInstrumentState) Register(inst metric.AsyncImpl, runner metric.AsyncRunner)

Register adds a new asynchronous instrument to by managed by this object. This should be called during NewAsyncInstrument() and assumes that errors (e.g., duplicate registration) have already been checked.

func (*AsyncInstrumentState) Run Uses

func (a *AsyncInstrumentState) Run(ctx context.Context, collector AsyncCollector)

Run executes the complete set of observer callbacks.

Package metric imports 7 packages (graph) and is imported by 2 packages. Updated 2020-11-24. Refresh now. Tools for package owners.