middleware

package
v0.0.0-...-d4224cb Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ApiRequestsTotal = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Name: "api_requests_total",
			Help: "A counter for total HTTP requests",
		},
		[]string{"code", "method", "path"},
	)
	ApiRequestsFailureTotal = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Name: "api_requests_failure_total",
			Help: "A counter for total HTTP request failures",
		},
		[]string{"code", "method", "path"},
	)
	ApiRequestsInFlight = prometheus.NewGauge(prometheus.GaugeOpts{
		Name: "api_requests_in_flight",
		Help: "A gauge of concurrent requests",
	})
	ApiRequestsDuration = prometheus.NewSummaryVec(
		prometheus.SummaryOpts{
			Name: "api_requests_duration_seconds",
			Help: "HTTP request latencies in seconds.",
		},
		[]string{"method", "path"},
	)
)

Functions

func Init

func Init(e *echo.Echo, c config.Config)

Init - Initialise custom middleware

func LogHTTPMetrics

func LogHTTPMetrics(next echo.HandlerFunc) echo.HandlerFunc

LogHTTPMetrics captures information about all incoming requests for Prometheus

Types

This section is empty.

Jump to

Keyboard shortcuts

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