prometheus

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PrometheusServer

type PrometheusServer struct {
	*sync.Closer
	// contains filtered or unexported fields
}

PrometheusServer is a prometheus server that serves metrics registered in the DefaultRegisterer. It is a wrapper around the promhttp.Handler() handler. The server will be started in a go-routine, and is gracefully stopped on close.

func NewPrometheusServer

func NewPrometheusServer(prometheusAddress string, logger *zap.Logger) (*PrometheusServer, error)

NewPrometheusServer creates a prometheus server if the metrics are enabled and address is set, and valid. Notice, this method does not start the server.

func (*PrometheusServer) Start

func (ps *PrometheusServer) Start()

Start will spawn a http server that will handle requests to /metrics and serves the metrics registered in the DefaultRegisterer.

Jump to

Keyboard shortcuts

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