Documentation ¶
Index ¶
- Variables
- func DefaultBucketer(desc sdkapi.Descriptor) tally.Buckets
- func KVsToTags(kvs []attribute.KeyValue) map[string]string
- func NewMeterProvider(scope tally.Scope, opts ...Opt) metric.MeterProvider
- type Counter
- type Histogram
- type HistogramBucketer
- type MeterImpl
- type MeterProvider
- type MeterScoper
- type Opt
Constants ¶
This section is empty.
Variables ¶
var ErrNonMonotonicValue = errors.New("unexpected non-monotonic value")
ErrNonMonotonicValue is a base error cause returned when a negative value is added to an increase-only Counter.
var ErrUnsupportedInstrument = errors.New("unsupported instrument")
ErrUnsupportedInstrument is used to signal that an instrument cannot be created by a Meter because the instrument kind and number kind together are not supported.
Functions ¶
func DefaultBucketer ¶ added in v0.4.0
func DefaultBucketer(desc sdkapi.Descriptor) tally.Buckets
DefaultBucketer is a HistogramBucketer that gives a hardcoded set of default buckets.
func NewMeterProvider ¶
func NewMeterProvider(scope tally.Scope, opts ...Opt) metric.MeterProvider
NewMeterProvider creates a new MeterProvider wrapping the provided tally.Scope.
Types ¶
type Counter ¶
type Counter struct {
// contains filtered or unexported fields
}
Counter implements the sdkapi.SyncImpl interface wrapping a tally.Counter
func NewCounter ¶
func NewCounter(desc sdkapi.Descriptor, scope tally.Scope) *Counter
NewCounter instantiates a new Counter that uses the provided scope as its base scope.
func (*Counter) Descriptor ¶
func (c *Counter) Descriptor() sdkapi.Descriptor
Descriptor observes this Counter's Descriptor object
func (*Counter) Implementation ¶
func (c *Counter) Implementation() interface{}
Implementation is unused
type Histogram ¶
type Histogram struct {
// contains filtered or unexported fields
}
Histogram is a sdkapi.SyncImpl implementation that bridges between an OTEL Histogram and a Tally Histogram.
func NewHistogram ¶
NewHistogram instantiates a new Histogram that uses the proved scope and bucket configuration.
func (*Histogram) Descriptor ¶
func (h *Histogram) Descriptor() sdkapi.Descriptor
Descriptor observes this Histogram's Descriptor object
func (*Histogram) Implementation ¶
func (h *Histogram) Implementation() interface{}
Implementation is unused
type HistogramBucketer ¶
type HistogramBucketer func(sdkapi.Descriptor) tally.Buckets
HistogramBucketer maps metric metadata to a tally.Buckets instance. This is necessary because OTEL does not have a way to indicate bucket confguration at histogram creation time.
type MeterImpl ¶
type MeterImpl struct {
// contains filtered or unexported fields
}
MeterImpl is an implementation of sdkapi.MeterImpl that uses Tally and wraps a tally.Scope
func NewMeterImpl ¶
func NewMeterImpl(scope tally.Scope, buckets HistogramBucketer) *MeterImpl
NewMeterImpl instantiates a MeterImpl wrapping the provided scope and using the provided bucket factory to configure buckets for histograms.
func (*MeterImpl) NewAsyncInstrument ¶
func (m *MeterImpl) NewAsyncInstrument( desc sdkapi.Descriptor, runner sdkapi.AsyncRunner, ) (sdkapi.AsyncImpl, error)
NewAsyncInstrument is required by the sdkapi.MeterImpl interface but no asynchronous instruments are supported because Tally doesn't support them.
func (*MeterImpl) NewSyncInstrument ¶
NewSyncInstrument creates new SyncInstrument objects to support OTEL metric instruments. Supported instruments are Counter (int64 only), UpDownCounter (int64 only), Histogram. If a requested instrument is not supported the error returned here will satisfy errors.Is(err, ErrorUnsupportedInstrument).
func (*MeterImpl) RecordBatch ¶
func (m *MeterImpl) RecordBatch( ctx context.Context, labels []attribute.KeyValue, measurements ...metric.Measurement, )
RecordBatch records multiple measurements to multiple instruments in a single call.
type MeterProvider ¶
type MeterProvider struct {
// contains filtered or unexported fields
}
MeterProvider is an implementation of metric.Meterprovider wrapping a tally.Scope.
func (*MeterProvider) Meter ¶
func (p *MeterProvider) Meter( instrumentationName string, opts ...metric.MeterOption, ) metric.Meter
Meter creates a new metric.Meter implementation that wraps a tally.Scope that is a sub-scope of the scope provided to this MeterProvider at construction time.
type MeterScoper ¶ added in v0.5.0
MeterScoper is a factory for scopes to be used in a Meter given a meter name and a base scope.
type Opt ¶
type Opt func(*MeterProvider)
Opt is the type for optional arguments to a MeterProvider.
func WithHistogramBucketer ¶
func WithHistogramBucketer(f HistogramBucketer) Opt
WithHistogramBucketer wraps a histogram bucket factory into a MeterProvider option
func WithMeterScoper ¶ added in v0.5.0
func WithMeterScoper(f MeterScoper) Opt
WithMeterScoper provides a MeterScoper to a MeterProvider at construction time
func WithScopeNameSeparator ¶ added in v0.6.0
WithScopeNameSeparator provides a string to a MeterProvider at construction time to be used in splitting child Meter names into scope names.