healthendpoint

package
v0.0.0-...-3ce1eab Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2019 License: Apache-2.0, BSD-3-Clause, MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartServer

func StartServer(addr string, gatherer prometheus.Gatherer) net.Listener

StartServer listens and serves the health endpoint HTTP handler on a given address. If the server fails to listen or serve the process will exit with a status code of 1.

Types

type Registrar

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

Registrar maintains a list of metrics to be served by the health endpoint server.

func New

func New(registrar prometheus.Registerer, gauges map[string]prometheus.Gauge) *Registrar

New returns an initialized health endpoint registrar configured with the given prmetheus.Registerer and map of prometheus.Gauges.

func (*Registrar) Dec

func (h *Registrar) Dec(name string)

Dec will decrement the gauge metric with the given name by 1. If the gauge metric is not found the process will exit with a status code of 1.

func (*Registrar) Inc

func (h *Registrar) Inc(name string)

Inc will increment the gauge metric with the given name by 1. If the gauge metric is not found the process will exit with a status code of 1.

func (*Registrar) Set

func (h *Registrar) Set(name string, value float64)

Set will set the given value on the gauge metric with the given name. If the gauge metric is not found the process will exit with a status code of 1.

Jump to

Keyboard shortcuts

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