Versions in this module Expand all Collapse all v1 v1.0.1 Feb 21, 2024 v1.0.0 Feb 21, 2024 Changes in this version + var EmitUnlabeledMetric = EmitUnlabeledMetricOption + var ErrAlreadySet = fmt.Errorf("cannot set metric keys more than once") + var ErrEmpty = fmt.Errorf("cannot set metric keys to an empty set") + var ErrNeverSet = fmt.Errorf("must call SetMetricKeys prior to using labeled package") + func GetUnlabeledMetricName(metricName string) string + func SetMetricKeys(keys ...contextutils.Key) + func UnsetMetricKeys() + type AdditionalLabelsOption struct + Labels []string + type Counter struct + func NewCounter(name, description string, scope promutils.Scope, opts ...MetricOption) Counter + func (c Counter) Add(ctx context.Context, v float64) + func (c Counter) Inc(ctx context.Context) + type EmitUnlabeledMetricOption struct + type Gauge struct + func NewGauge(name, description string, scope promutils.Scope, opts ...MetricOption) Gauge + func (g Gauge) Add(ctx context.Context, v float64) + func (g Gauge) Dec(ctx context.Context) + func (g Gauge) Inc(ctx context.Context) + func (g Gauge) Set(ctx context.Context, v float64) + func (g Gauge) SetToCurrentTime(ctx context.Context) + func (g Gauge) Sub(ctx context.Context, v float64) + type MetricOption interface + type StopWatch struct + func NewStopWatch(name, description string, scale time.Duration, scope promutils.Scope, ...) StopWatch + func (c StopWatch) Observe(ctx context.Context, start, end time.Time) + func (c StopWatch) Start(ctx context.Context) Timer + func (c StopWatch) Time(ctx context.Context, f func()) + type Summary struct + func NewSummary(name, description string, scope promutils.Scope, opts ...MetricOption) Summary + func (s Summary) Observe(ctx context.Context, v float64) + type Timer interface + Stop func() float64