metrics

package
v0.0.0-...-495eea3 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MetricRequestsTotal = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Name: "http_request_total",
			Help: "HTTP Request Count.",
		},
		[]string{"status", "path"},
	)
	MetricRequestDurationSecondsBucket = prometheus.NewHistogramVec(
		prometheus.HistogramOpts{
			Name:    "http_request_duration_seconds_bucket",
			Help:    "Histogram of latencies for HTTP requests.",
			Buckets: []float64{0.1, 0.2, 0.4, 1, 3, 8, 20, 60, 120},
		},
		[]string{"status", "path"},
	)
)

Functions

func MetricsMiddleware

func MetricsMiddleware(config Config) func(http.Handler) http.Handler

Types

type Config

type Config struct {
	IgnorePaths []string `conf:"ignore_paths"`
}

Jump to

Keyboard shortcuts

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