Documentation ¶
Index ¶
- type Factory
- func (f *Factory) Counter(options metrics.Options) metrics.Counter
- func (f *Factory) Gauge(options metrics.Options) metrics.Gauge
- func (f *Factory) Histogram(options metrics.HistogramOptions) metrics.Histogram
- func (f *Factory) Namespace(scope metrics.NSOptions) metrics.Factory
- func (f *Factory) Timer(options metrics.TimerOptions) metrics.Timer
- type Option
- type Separator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Factory ¶
type Factory struct {
// contains filtered or unexported fields
}
Factory implements metrics.Factory backed by Prometheus registry.
func New ¶
New creates a Factory backed by Prometheus registry. Typically the first argument should be prometheus.DefaultRegisterer.
Parameter buckets defines the buckets into which Timer observations are counted. Each element in the slice is the upper inclusive bound of a bucket. The values must be sorted in strictly increasing order. There is no need to add a highest bucket with +Inf bound, it will be added implicitly. The default value is prometheus.DefBuckets.
func (*Factory) Histogram ¶
func (f *Factory) Histogram(options metrics.HistogramOptions) metrics.Histogram
Histogram implements Histogram of metrics.Factory.
type Option ¶ added in v1.2.1
type Option func(*options)
Option is a function that sets some option for the Factory constructor.
func WithBuckets ¶ added in v1.2.1
WithBuckets returns an option that sets the default buckets for histogram. If not used, we fallback to default Prometheus buckets.
func WithRegisterer ¶ added in v1.2.1
func WithRegisterer(registerer prometheus.Registerer) Option
WithRegisterer returns an option that sets the registerer. If not used we fallback to prometheus.DefaultRegisterer.
func WithSeparator ¶ added in v1.5.0
WithSeparator returns an option that sets the default separator for the namespace If not used, we fallback to underscore.