package metric
import "go.opentelemetry.io/otel/internal/metric"
Index ¶
- Variables
- type Async
- type AsyncCollector
- type AsyncInstrumentState
- func NewAsyncInstrumentState(errorHandler func(error)) *AsyncInstrumentState
- func (a *AsyncInstrumentState) Instruments() []metric.AsyncImpl
- func (a *AsyncInstrumentState) Register(inst metric.AsyncImpl, runner metric.AsyncRunner)
- func (a *AsyncInstrumentState) Run(collector AsyncCollector)
- type Batch
- type Handle
- type Instrument
- type Measurement
- type MeterImpl
- func NewMeter() (*MeterImpl, apimetric.Meter)
- func NewProvider() (*MeterImpl, apimetric.Provider)
- func (m *MeterImpl) CollectAsync(labels []kv.KeyValue, obs ...metric.Observation)
- func (m *MeterImpl) NewAsyncInstrument(descriptor metric.Descriptor, runner metric.AsyncRunner) (apimetric.AsyncImpl, error)
- func (m *MeterImpl) NewSyncInstrument(descriptor metric.Descriptor) (apimetric.SyncImpl, error)
- func (m *MeterImpl) RecordBatch(ctx context.Context, labels []kv.KeyValue, measurements ...apimetric.Measurement)
- func (m *MeterImpl) RunAsyncInstruments()
- type MeterProvider
- type Sync
Variables ¶
Types ¶
type Async ¶
type Async struct { Instrument // contains filtered or unexported fields }
func (*Async) Implementation ¶
func (a *Async) Implementation() interface{}
type AsyncCollector ¶
type AsyncCollector interface { // CollectAsync passes a batch of observations to the MeterImpl. CollectAsync([]kv.KeyValue, ...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 ¶
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 ¶
func NewAsyncInstrumentState(errorHandler func(error)) *AsyncInstrumentState
NewAsyncInstrumentState returns a new *AsyncInstrumentState, for use by MeterImpl to manage running the set of observer callbacks in the correct order.
errorHandler is used to print an error condition. If errorHandler nil, the default error handler will be used that prints to os.Stderr. Only the first error is passed to the handler, after which errors are skipped.
func (*AsyncInstrumentState) Instruments ¶
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 ¶
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 ¶
func (a *AsyncInstrumentState) Run(collector AsyncCollector)
Run executes the complete set of observer callbacks.
type Batch ¶
type Batch struct { // Measurement needs to be aligned for 64-bit atomic operations. Measurements []Measurement Ctx context.Context Labels []kv.KeyValue LibraryName string }
type Handle ¶
func (*Handle) RecordOne ¶
func (*Handle) Unbind ¶
func (h *Handle) Unbind()
type Instrument ¶
type Instrument struct {
// contains filtered or unexported fields
}
func (Instrument) Descriptor ¶
func (i Instrument) Descriptor() apimetric.Descriptor
type Measurement ¶
type Measurement struct { // Number needs to be aligned for 64-bit atomic operations. Number apimetric.Number Instrument apimetric.InstrumentImpl }
type MeterImpl ¶
type MeterImpl struct { MeasurementBatches []Batch // contains filtered or unexported fields }
func NewMeter ¶
func NewProvider ¶
func (*MeterImpl) CollectAsync ¶
func (m *MeterImpl) CollectAsync(labels []kv.KeyValue, obs ...metric.Observation)
func (*MeterImpl) NewAsyncInstrument ¶
func (m *MeterImpl) NewAsyncInstrument(descriptor metric.Descriptor, runner metric.AsyncRunner) (apimetric.AsyncImpl, error)
func (*MeterImpl) NewSyncInstrument ¶
func (*MeterImpl) RecordBatch ¶
func (m *MeterImpl) RecordBatch(ctx context.Context, labels []kv.KeyValue, measurements ...apimetric.Measurement)
func (*MeterImpl) RunAsyncInstruments ¶
func (m *MeterImpl) RunAsyncInstruments()
type MeterProvider ¶
type MeterProvider struct {
// contains filtered or unexported fields
}
func (*MeterProvider) Meter ¶
func (p *MeterProvider) Meter(name string) apimetric.Meter
type Sync ¶
type Sync struct { Instrument }
func (*Sync) Bind ¶
func (s *Sync) Bind(labels []kv.KeyValue) apimetric.BoundSyncImpl
func (*Sync) Implementation ¶
func (s *Sync) Implementation() interface{}
func (*Sync) RecordOne ¶
Source Files ¶
async.go mock.go
- Version
- v0.5.0
- Published
- May 14, 2020
- Platform
- js/wasm
- Imports
- 8 packages
- Last checked
- 19 minutes ago –
Tools for package owners.