prometheus

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2020 License: MIT Imports: 7 Imported by: 1

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 FQN

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

FQN is a name formatter.

func NewFQN

func NewFQN() *FQN

NewFQN returns an FQN formatter.

func (*FQN) Format

func (f *FQN) Format(name string) string

Format formats a name to be a fully qualified name.

type Logger added in v1.4.0

type Logger interface {
	Error(msg string, ctx ...interface{})
}

Logger represents an abstract logging object.

type Prometheus

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

Prometheus is a prometheus stats collector.

func New

func New(prefix string) *Prometheus

New returns a new prometheus stats instance.

func (*Prometheus) Close

func (s *Prometheus) Close() error

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

func (*Prometheus) Dec

func (s *Prometheus) Dec(name string, value int64, rate float32, tags ...string)

Dec decrements a count by the value.

func (*Prometheus) Gauge

func (s *Prometheus) Gauge(name string, value float64, rate float32, tags ...string)

Gauge measures the value of a metric.

func (*Prometheus) Handler

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

Handler gets the prometheus HTTP handler.

func (*Prometheus) Inc

func (s *Prometheus) Inc(name string, value int64, rate float32, tags ...string)

Inc increments a count by the value.

func (*Prometheus) Timing

func (s *Prometheus) Timing(name string, value time.Duration, rate float32, tags ...string)

Timing sends the value of a Duration.

Jump to

Keyboard shortcuts

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