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

package registry

import "go.opentelemetry.io/otel/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.


Package Files

doc.go registry.go


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.

func Compatible Uses

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 Uses

func NewMetricKindMismatchError(desc metric.Descriptor) error

NewMetricKindMismatchError formats an error that describes a mismatched metric instrument definition.

func NewUniqueInstrumentMeterImpl Uses

func NewUniqueInstrumentMeterImpl(impl metric.MeterImpl) metric.MeterImpl

NewUniqueInstrumentMeterImpl returns a wrapped metric.MeterImpl with the addition of uniqueness checking.

type MeterProvider Uses

type MeterProvider struct {
    // contains filtered or unexported fields

MeterProvider is a standard MeterProvider for wrapping `MeterImpl`

func NewMeterProvider Uses

func NewMeterProvider(impl metric.MeterImpl) *MeterProvider

NewMeterProvider returns a new provider that implements instrument name-uniqueness checking.

func (*MeterProvider) Meter Uses

func (p *MeterProvider) Meter(instrumentationName string, opts ...metric.MeterOption) metric.Meter

Meter implements MeterProvider.

Package registry imports 5 packages (graph) and is imported by 5 packages. Updated 2020-11-19. Refresh now. Tools for package owners.