metrics

package
v0.0.0-...-6094a08 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultRequestDurationBuckets  = prometheus.ExponentialBuckets(0.005, 2, 10)
	DefaultRequestBodySizeBuckets  = prometheus.ExponentialBuckets(8, 2, 10)
	DefaultResponseBodySizeBuckets = prometheus.ExponentialBuckets(8, 2, 10)
)

Functions

func WithMetrics

func WithMetrics(h http.HandlerFunc, cfg Config) http.HandlerFunc

Types

type Config

type Config struct {
	Prefix                  string
	RequestDurationBuckets  []float64
	RequestBodySizeBuckets  []float64
	ResponseBodySizeBuckets []float64
}

func (Config) WithDefaults

func (cfg Config) WithDefaults() Config

Jump to

Keyboard shortcuts

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