Documentation ¶
Index ¶
- type Provider
- func NewDiscardProvider() Provider
- func NewDogStatsdProvider(network, address, prefix string, interval time.Duration, logger log.Logger) (Provider, error)
- func NewExpvarProvider(prefix string) Provider
- func NewGraphiteProvider(network, address, prefix string, interval time.Duration, logger log.Logger) (Provider, error)
- func NewPrometheusProvider(namespace, subsystem string) Provider
- func NewStatsdProvider(network, address, prefix string, interval time.Duration, logger log.Logger) (Provider, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Provider ¶
type Provider interface { NewCounter(name, help string) metrics.Counter NewHistogram(name, help string, min, max int64, sigfigs int, quantiles ...int) (metrics.Histogram, error) NewGauge(name, help string) metrics.Gauge Stop() }
Provider represents a union set of constructors and lifecycle management functions for each supported metrics backend. It should be used by those who need to easily swap out implementations, e.g. dynamically, or at a single point in an intermediating framework.
func NewDiscardProvider ¶
func NewDiscardProvider() Provider
NewDiscardProvider returns a provider that will discard all metrics.
func NewDogStatsdProvider ¶
func NewDogStatsdProvider(network, address, prefix string, interval time.Duration, logger log.Logger) (Provider, error)
NewDogStatsdProvider will return a Provider implementation that is a simple wrapper around a dogstatsd.Emitter. All metric names will be prefixed with the given value and data will be emitted once every interval or when the buffer has reached its max size. If no network value is given, it will default to "udp".
func NewExpvarProvider ¶
NewExpvarProvider is a very thin wrapper over the expvar package. If a prefix is provided, it will prefix all metric names.
func NewGraphiteProvider ¶
func NewGraphiteProvider(network, address, prefix string, interval time.Duration, logger log.Logger) (Provider, error)
NewGraphiteProvider will return a Provider implementation that is a simple wrapper around a graphite.Emitter. All metric names will be prefixed with the given value and data will be emitted once every interval. If no network value is given, it will default to "udp".
func NewPrometheusProvider ¶
NewPrometheusProvider returns a Prometheus provider that uses the provided namespace and subsystem for all metrics.
func NewStatsdProvider ¶
func NewStatsdProvider(network, address, prefix string, interval time.Duration, logger log.Logger) (Provider, error)
NewStatsdProvider will return a Provider implementation that is a simple wrapper around a statsd.Emitter. All metric names will be prefixed with the given value and data will be emitted once every interval or when the buffer has reached its max size. If no network value is given, it will default to "udp".