httpmetrics

package
v1.51.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Wrap

func Wrap(h http.Handler, metricsFactory metrics.Factory, logger *zap.Logger) http.Handler

Wrap returns a handler that wraps the provided one and emits metrics based on the HTTP requests and responses. It will record the HTTP response status, HTTP method, duration and path of the call. The duration will be reported in metrics.Timer and the rest will be labels on that timer.

Do not use with HTTP endpoints that take parameters from URL path, such as `/user/{user_id}`, because they will result in high cardinality metrics.

Types

This section is empty.

Jump to

Keyboard shortcuts

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