Documentation
¶
Overview ¶
Package metrics provides a metrics-tracking implementation for the service.
What to use and when:
Use Counters for counting things that always go up. Use Gauges for things that can go up or down. Use Histograms or Summaries for distributions of values.
Index ¶
- func Int64CounterForTest(name string) metric.Int64Counter
- type Float64Counter
- type Float64CounterImpl
- type Float64Gauge
- type Float64GaugeImpl
- type Float64Histogram
- type Float64HistogramImpl
- type Float64UpDownCounter
- type Float64UpDownCounterImpl
- type Int64Counter
- type Int64CounterImpl
- type Int64Gauge
- type Int64GaugeImpl
- type Int64Histogram
- type Int64HistogramImpl
- type Int64UpDownCounter
- type Int64UpDownCounterImpl
- type MockProvider
- func (m *MockProvider) MeterProvider() metric.MeterProvider
- func (m *MockProvider) NewFloat64Counter(name string, options ...metric.Float64CounterOption) (Float64Counter, error)
- func (m *MockProvider) NewFloat64Gauge(name string, options ...metric.Float64GaugeOption) (Float64Gauge, error)
- func (m *MockProvider) NewFloat64Histogram(name string, options ...metric.Float64HistogramOption) (Float64Histogram, error)
- func (m *MockProvider) NewFloat64UpDownCounter(name string, options ...metric.Float64UpDownCounterOption) (Float64UpDownCounter, error)
- func (m *MockProvider) NewInt64Counter(name string, options ...metric.Int64CounterOption) (Int64Counter, error)
- func (m *MockProvider) NewInt64Gauge(name string, options ...metric.Int64GaugeOption) (Int64Gauge, error)
- func (m *MockProvider) NewInt64Histogram(name string, options ...metric.Int64HistogramOption) (Int64Histogram, error)
- func (m *MockProvider) NewInt64UpDownCounter(name string, options ...metric.Int64UpDownCounterOption) (Int64UpDownCounter, error)
- func (m *MockProvider) Shutdown(ctx context.Context) error
- type Provider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Int64CounterForTest ¶
func Int64CounterForTest(name string) metric.Int64Counter
Types ¶
type Float64Counter ¶
type Float64CounterImpl ¶
type Float64CounterImpl struct {
X metric.Float64Counter
}
type Float64Gauge ¶
type Float64Gauge interface {
Record(ctx context.Context, value float64, options ...metric.RecordOption)
}
type Float64GaugeImpl ¶
type Float64GaugeImpl struct {
X metric.Float64Gauge
}
func (*Float64GaugeImpl) Record ¶
func (y *Float64GaugeImpl) Record(ctx context.Context, value float64, options ...metric.RecordOption)
Record wraps the metric float64Gauge interface.
type Float64Histogram ¶
type Float64Histogram interface {
Record(ctx context.Context, incr float64, options ...metric.RecordOption)
}
type Float64HistogramImpl ¶
type Float64HistogramImpl struct {
X metric.Float64Histogram
}
func (*Float64HistogramImpl) Record ¶
func (y *Float64HistogramImpl) Record(ctx context.Context, incr float64, options ...metric.RecordOption)
Record wraps the metric float64Histogram interface.
type Float64UpDownCounter ¶
type Float64UpDownCounterImpl ¶
type Float64UpDownCounterImpl struct {
X metric.Float64UpDownCounter
}
type Int64Counter ¶
type Int64CounterImpl ¶
type Int64CounterImpl struct {
X metric.Int64Counter
}
type Int64Gauge ¶
type Int64Gauge interface {
Record(ctx context.Context, value int64, options ...metric.RecordOption)
}
type Int64GaugeImpl ¶
type Int64GaugeImpl struct {
X metric.Int64Gauge
}
func (*Int64GaugeImpl) Record ¶
func (y *Int64GaugeImpl) Record(ctx context.Context, value int64, options ...metric.RecordOption)
Record wraps the metric int64Gauge interface.
type Int64Histogram ¶
type Int64Histogram interface {
Record(ctx context.Context, incr int64, options ...metric.RecordOption)
}
type Int64HistogramImpl ¶
type Int64HistogramImpl struct {
X metric.Int64Histogram
}
func (*Int64HistogramImpl) Record ¶
func (y *Int64HistogramImpl) Record(ctx context.Context, incr int64, options ...metric.RecordOption)
Record wraps the metric int64Histogram interface.
type Int64UpDownCounter ¶
type Int64UpDownCounterImpl ¶
type Int64UpDownCounterImpl struct {
X metric.Int64UpDownCounter
}
type MockProvider ¶
func (*MockProvider) MeterProvider ¶
func (m *MockProvider) MeterProvider() metric.MeterProvider
MeterProvider satisfies our interface.
func (*MockProvider) NewFloat64Counter ¶
func (m *MockProvider) NewFloat64Counter(name string, options ...metric.Float64CounterOption) (Float64Counter, error)
NewFloat64Counter satisfies our interface.
func (*MockProvider) NewFloat64Gauge ¶
func (m *MockProvider) NewFloat64Gauge(name string, options ...metric.Float64GaugeOption) (Float64Gauge, error)
NewFloat64Gauge satisfies our interface.
func (*MockProvider) NewFloat64Histogram ¶
func (m *MockProvider) NewFloat64Histogram(name string, options ...metric.Float64HistogramOption) (Float64Histogram, error)
NewFloat64Histogram satisfies our interface.
func (*MockProvider) NewFloat64UpDownCounter ¶
func (m *MockProvider) NewFloat64UpDownCounter(name string, options ...metric.Float64UpDownCounterOption) (Float64UpDownCounter, error)
NewFloat64UpDownCounter satisfies our interface.
func (*MockProvider) NewInt64Counter ¶
func (m *MockProvider) NewInt64Counter(name string, options ...metric.Int64CounterOption) (Int64Counter, error)
NewInt64Counter satisfies our interface.
func (*MockProvider) NewInt64Gauge ¶
func (m *MockProvider) NewInt64Gauge(name string, options ...metric.Int64GaugeOption) (Int64Gauge, error)
NewInt64Gauge satisfies our interface.
func (*MockProvider) NewInt64Histogram ¶
func (m *MockProvider) NewInt64Histogram(name string, options ...metric.Int64HistogramOption) (Int64Histogram, error)
NewInt64Histogram satisfies our interface.
func (*MockProvider) NewInt64UpDownCounter ¶
func (m *MockProvider) NewInt64UpDownCounter(name string, options ...metric.Int64UpDownCounterOption) (Int64UpDownCounter, error)
NewInt64UpDownCounter satisfies our interface.
type Provider ¶
type Provider interface {
NewFloat64Counter(name string, options ...metric.Float64CounterOption) (Float64Counter, error)
NewFloat64Gauge(name string, options ...metric.Float64GaugeOption) (Float64Gauge, error)
NewFloat64UpDownCounter(name string, options ...metric.Float64UpDownCounterOption) (Float64UpDownCounter, error)
NewFloat64Histogram(name string, options ...metric.Float64HistogramOption) (Float64Histogram, error)
NewInt64Counter(name string, options ...metric.Int64CounterOption) (Int64Counter, error)
NewInt64Gauge(name string, options ...metric.Int64GaugeOption) (Int64Gauge, error)
NewInt64UpDownCounter(name string, options ...metric.Int64UpDownCounterOption) (Int64UpDownCounter, error)
NewInt64Histogram(name string, options ...metric.Int64HistogramOption) (Int64Histogram, error)
Shutdown(ctx context.Context) error
MeterProvider() metric.MeterProvider
}
func EnsureMetricsProvider ¶
func NewNoopMetricsProvider ¶
func NewNoopMetricsProvider() Provider