metrics

package
Version: v0.0.0-...-989ac5f Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2021 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
}

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

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL