package registry
import "go.opentelemetry.io/otel/internal/metric/registry"
Package registry provides a non-standalone implementation of MeterProvider that adds uniqueness checking for instrument descriptors on top of other MeterProvider it wraps.
This package is currently in a pre-GA phase. Backwards incompatible changes may be introduced in subsequent minor version releases as we work to track the evolving OpenTelemetry specification and user feedback.
Index ¶
- Variables
- func Compatible(candidate, existing metric.Descriptor) bool
- func NewMetricKindMismatchError(desc metric.Descriptor) error
- type UniqueInstrumentMeterImpl
- func NewUniqueInstrumentMeterImpl(impl metric.MeterImpl) *UniqueInstrumentMeterImpl
- func (u *UniqueInstrumentMeterImpl) MeterImpl() metric.MeterImpl
- func (u *UniqueInstrumentMeterImpl) NewAsyncInstrument( descriptor metric.Descriptor, runner metric.AsyncRunner, ) (metric.AsyncImpl, error)
- func (u *UniqueInstrumentMeterImpl) NewSyncInstrument(descriptor metric.Descriptor) (metric.SyncImpl, error)
- func (u *UniqueInstrumentMeterImpl) RecordBatch(ctx context.Context, labels []attribute.KeyValue, ms ...metric.Measurement)
Variables ¶
var ErrMetricKindMismatch = fmt.Errorf( "a metric was already registered by this name with another kind or number type")
ErrMetricKindMismatch is the standard error for mismatched metric instrument definitions.
Functions ¶
func Compatible ¶
func Compatible(candidate, existing metric.Descriptor) bool
Compatible determines whether two metric.Descriptors are considered the same for the purpose of uniqueness checking.
func NewMetricKindMismatchError ¶
func NewMetricKindMismatchError(desc metric.Descriptor) error
NewMetricKindMismatchError formats an error that describes a mismatched metric instrument definition.
Types ¶
type UniqueInstrumentMeterImpl ¶
type UniqueInstrumentMeterImpl struct {
// contains filtered or unexported fields
}
UniqueInstrumentMeterImpl implements the metric.MeterImpl interface, adding uniqueness checking for instrument descriptors.
func NewUniqueInstrumentMeterImpl ¶
func NewUniqueInstrumentMeterImpl(impl metric.MeterImpl) *UniqueInstrumentMeterImpl
NewUniqueInstrumentMeterImpl returns a wrapped metric.MeterImpl with the addition of instrument name uniqueness checking.
func (*UniqueInstrumentMeterImpl) MeterImpl ¶
func (u *UniqueInstrumentMeterImpl) MeterImpl() metric.MeterImpl
MeterImpl gives the caller access to the underlying MeterImpl used by this UniqueInstrumentMeterImpl.
func (*UniqueInstrumentMeterImpl) NewAsyncInstrument ¶
func (u *UniqueInstrumentMeterImpl) NewAsyncInstrument( descriptor metric.Descriptor, runner metric.AsyncRunner, ) (metric.AsyncImpl, error)
NewAsyncInstrument implements metric.MeterImpl.
func (*UniqueInstrumentMeterImpl) NewSyncInstrument ¶
func (u *UniqueInstrumentMeterImpl) NewSyncInstrument(descriptor metric.Descriptor) (metric.SyncImpl, error)
NewSyncInstrument implements metric.MeterImpl.
func (*UniqueInstrumentMeterImpl) RecordBatch ¶
func (u *UniqueInstrumentMeterImpl) RecordBatch(ctx context.Context, labels []attribute.KeyValue, ms ...metric.Measurement)
RecordBatch implements metric.MeterImpl.
Source Files ¶
doc.go registry.go
- Version
- v0.24.0
- Published
- Oct 1, 2021
- Platform
- js/wasm
- Imports
- 5 packages
- Last checked
- 5 hours ago –
Tools for package owners.