prometheus

package
v2.2.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 23, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

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

func New(opts ...Option) *Factory

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) Counter

func (f *Factory) Counter(options metrics.Options) metrics.Counter

Counter implements Counter of metrics.Factory.

func (*Factory) Gauge

func (f *Factory) Gauge(options metrics.Options) metrics.Gauge

Gauge implements Gauge of metrics.Factory.

func (*Factory) Histogram

func (f *Factory) Histogram(options metrics.HistogramOptions) metrics.Histogram

Histogram implements Histogram of metrics.Factory.

func (*Factory) Namespace

func (f *Factory) Namespace(scope metrics.NSOptions) metrics.Factory

Namespace implements Namespace of metrics.Factory.

func (*Factory) Timer

func (f *Factory) Timer(options metrics.TimerOptions) metrics.Timer

Timer implements Timer 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

func WithBuckets(buckets []float64) Option

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

func WithSeparator(separator Separator) Option

WithSeparator returns an option that sets the default separator for the namespace If not used, we fallback to underscore.

type Separator added in v1.5.0

type Separator rune

Separator represents the namespace separator to use

const (
	// SeparatorUnderscore uses an underscore as separator
	SeparatorUnderscore Separator = '_'

	// SeparatorColon uses a colon as separator
	SeparatorColon = ':'
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL