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 sdkapi.Descriptor) bool
- func NewMetricKindMismatchError(desc sdkapi.Descriptor) error
- type UniqueInstrumentMeterImpl
- func NewUniqueInstrumentMeterImpl(impl sdkapi.MeterImpl) *UniqueInstrumentMeterImpl
- func (u *UniqueInstrumentMeterImpl) MeterImpl() sdkapi.MeterImpl
- func (u *UniqueInstrumentMeterImpl) NewAsyncInstrument( descriptor sdkapi.Descriptor, runner sdkapi.AsyncRunner, ) (sdkapi.AsyncImpl, error)
- func (u *UniqueInstrumentMeterImpl) NewSyncInstrument(descriptor sdkapi.Descriptor) (sdkapi.SyncImpl, error)
- func (u *UniqueInstrumentMeterImpl) RecordBatch(ctx context.Context, labels []attribute.KeyValue, ms ...sdkapi.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 sdkapi.Descriptor) bool
Compatible determines whether two sdkapi.Descriptors are considered the same for the purpose of uniqueness checking.
func NewMetricKindMismatchError ¶
func NewMetricKindMismatchError(desc sdkapi.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 sdkapi.MeterImpl) *UniqueInstrumentMeterImpl
NewUniqueInstrumentMeterImpl returns a wrapped metric.MeterImpl with the addition of instrument name uniqueness checking.
func (*UniqueInstrumentMeterImpl) MeterImpl ¶
func (u *UniqueInstrumentMeterImpl) MeterImpl() sdkapi.MeterImpl
MeterImpl gives the caller access to the underlying MeterImpl used by this UniqueInstrumentMeterImpl.
func (*UniqueInstrumentMeterImpl) NewAsyncInstrument ¶
func (u *UniqueInstrumentMeterImpl) NewAsyncInstrument( descriptor sdkapi.Descriptor, runner sdkapi.AsyncRunner, ) (sdkapi.AsyncImpl, error)
NewAsyncInstrument implements sdkapi.MeterImpl.
func (*UniqueInstrumentMeterImpl) NewSyncInstrument ¶
func (u *UniqueInstrumentMeterImpl) NewSyncInstrument(descriptor sdkapi.Descriptor) (sdkapi.SyncImpl, error)
NewSyncInstrument implements sdkapi.MeterImpl.
func (*UniqueInstrumentMeterImpl) RecordBatch ¶
func (u *UniqueInstrumentMeterImpl) RecordBatch(ctx context.Context, labels []attribute.KeyValue, ms ...sdkapi.Measurement)
RecordBatch implements sdkapi.MeterImpl.
Source Files ¶
doc.go registry.go
- Version
- v0.27.0 (latest)
- Published
- Feb 11, 2022
- Platform
- linux/amd64
- Imports
- 5 packages
- Last checked
- 5 hours ago –
Tools for package owners.