metrics

package
v0.0.0-...-0631483 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var HttpRequestsDurationSeconds = promauto.NewHistogramVec(
	prometheus.HistogramOpts{
		Name: "http_requests_duration_seconds",
		Help: "Duration of HTTP requests.",
	},
	[]string{"path"},
)
View Source
var HttpRequestsTotal = promauto.NewCounterVec(
	prometheus.CounterOpts{
		Name: "http_requests_total",
		Help: "Number of HTTP requests.",
	},
	[]string{"path"},
)
View Source
var HttpResponseStatusCodesTotal = promauto.NewCounterVec(
	prometheus.CounterOpts{
		Name: "http_response_status_codes_total",
		Help: "Number of response status codes for path",
	},
	[]string{"path", "code"},
)

Functions

func PrometheusMiddleware

func PrometheusMiddleware(nextHandler http.Handler) http.Handler

PrometheusMiddleware adds basic metrics to all http requests

func RunMetricsServer

func RunMetricsServer(address string) error

RunMetricsServer runs http server for prometheus metrics

Types

This section is empty.

Jump to

Keyboard shortcuts

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