metrics

package
v0.0.0-...-bb7b23f Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InstrumentHandler

func InstrumentHandler(next http.Handler, _http Http) http.HandlerFunc

InstrumentHandler returns a handler which records HTTP requests as they are made

Types

type Http

type Http struct {
	RequestsTotal            *prometheus.CounterVec
	RequestDurationHistogram *prometheus.HistogramVec
	InFlight                 prometheus.Gauge
}

func NewHttp

func NewHttp() Http

type MetricsServer

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

MetricsServer provides instrumentation for HTTP calls

func (*MetricsServer) Register

func (m *MetricsServer) Register(metricsPort int)

Register binds a HTTP server to expose Prometheus metrics

func (*MetricsServer) Serve

func (m *MetricsServer) Serve(cancel chan bool)

Serve http traffic in go routine, non-blocking

Jump to

Keyboard shortcuts

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