prometheus

package
v2.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2021 License: MIT Imports: 9 Imported by: 3

Documentation

Overview

Package prometheus implements an prometheus stats client.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(p *Prometheus)

Option represents statsd option function.

func WithBuckets

func WithBuckets(buckets []float64) Option

WithBuckets sets the buckets to used with histograms.

type Prometheus

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

Prometheus is a prometheus stats collector.

func New

func New(namespace string, opts ...Option) *Prometheus

New returns a new prometheus reporter.

func (*Prometheus) Close

func (p *Prometheus) Close() error

Close closes the client and flushes buffered stats, if applicable.

func (*Prometheus) Counter

func (p *Prometheus) Counter(name string, v int64, tags [][2]string)

Counter reports a counter value.

func (*Prometheus) Gauge

func (p *Prometheus) Gauge(name string, v float64, tags [][2]string)

Gauge reports a gauge value.

func (*Prometheus) Handler

func (p *Prometheus) Handler() http.Handler

Handler gets the prometheus HTTP handler.

func (*Prometheus) Histogram

func (p *Prometheus) Histogram(name string, tags [][2]string) func(v float64)

Histogram reports a histogram value.

func (*Prometheus) Timing

func (p *Prometheus) Timing(name string, tags [][2]string) func(v time.Duration)

Timing reports a timing value as a histogram in seconds.

Jump to

Keyboard shortcuts

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