metrics

package
v0.3.0-docs.0...-f96dd80 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package metrics implements an HTTP metrics server along with its life cycle: start, shutdown, and register metrics.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Registerer

type Registerer interface {
	RegisterMetrics(Registry)
}

type Registry

type Registry interface {
	Register(prometheus.Collector) error
	MustRegister(...prometheus.Collector)
}

Registry defines the interface of the prometheus metrics registry

type Server

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

A metrics server holds the http API and the prometheus registry which provides access to the registered metrics.

func NewServer

func NewServer(addr string) *Server

Create new metrics server. Do not listen to the given address until the server is started.

func (Server) MustRegister

func (m Server) MustRegister(collectors ...prometheus.Collector)

MustRegister registers multiple prometheus collectors in the prometheus registry used by the metrics server.

func (Server) Register

func (m Server) Register(collector prometheus.Collector) error

Register registers a prometheus collector in the prometheus registry used by the metrics server.

func (Server) Shutdown

func (m Server) Shutdown()

Shutdown gracefully shutdowns metrics http server waiting 5 seconds for connections to be closed.

func (Server) Start

func (m Server) Start()

Listens on the configured address and blocks until shutdown is called.

Jump to

Keyboard shortcuts

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