Documentation
¶
Overview ¶
Package prometheus implements an prometheus stats client.
Index ¶
- type Option
- type Prometheus
- func (p *Prometheus) Close() error
- func (p *Prometheus) Counter(name string, v int64, tags [][2]string)
- func (p *Prometheus) Gauge(name string, v float64, tags [][2]string)
- func (p *Prometheus) Handler() http.Handler
- func (p *Prometheus) Histogram(name string, tags [][2]string) func(v float64)
- func (p *Prometheus) Timing(name string, tags [][2]string) func(v time.Duration)
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 ¶
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.
Click to show internal directories.
Click to hide internal directories.