metrics

package
v0.0.0-...-14308cf Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2019 License: Apache-2.0 Imports: 8 Imported by: 19

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Counter

type Counter interface {
	Add(float64)
}

type Gauge

type Gauge interface {
	Add(float64)
	Set(float64)
}

type MetricOption

type MetricOption func(o *prometheus.Opts)

func WithHelpText

func WithHelpText(helpText string) MetricOption

func WithMetricTags

func WithMetricTags(tags map[string]string) MetricOption

type PromRegistry

type PromRegistry struct {
	// contains filtered or unexported fields
}

func NewPromRegistry

func NewPromRegistry(defaultSourceID string, logger *log.Logger, opts ...RegistryOption) *PromRegistry

By default, the prom registry will register the metrics route with the default http mux but will not start a http server. This is intentional so that we can combine metrics with other things like pprof into one server. To start a server just for metrics, the WithServer RegistryOption

func (*PromRegistry) NewCounter

func (p *PromRegistry) NewCounter(name string, opts ...MetricOption) Counter

func (*PromRegistry) NewGauge

func (p *PromRegistry) NewGauge(name string, opts ...MetricOption) Gauge

func (*PromRegistry) Port

func (p *PromRegistry) Port() string

type RegistryOption

type RegistryOption func(r *PromRegistry)

func WithDefaultTags

func WithDefaultTags(tags map[string]string) RegistryOption

func WithServer

func WithServer(port int) RegistryOption

Jump to

Keyboard shortcuts

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