metrics

package
v0.0.0-...-ffd9c73 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package metrics implements a metrics middleware for an HTTP server that records metrics data for Prometheus.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(metrics Metrics) func(http.Handler) http.Handler

Types

type Metrics

type Metrics interface {
	RequestCountInc(routePattern string, statusCode int)
	ResponseBytesCountAdd(routePattern string, statusCode int, bytesWritten int)
	InflightRequestsGaugeAdd(addition int)
	ResponseTimeHistogramObserve(routePattern string, statusCode int, duration time.Duration)
}

Jump to

Keyboard shortcuts

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