Documentation ¶
Index ¶
- func DefaultPathFormater(_ int, path string) string
- func HTTPHandler(h http.Handler, pathFormatters ...PathFormater) http.Handler
- func HTTPTransport(t http.RoundTripper, pathFormatters ...PathFormater) http.RoundTripper
- func Middleware(pathFormatters ...PathFormater) func(h http.Handler) http.Handler
- type PathFormater
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultPathFormater ¶
The default path formater used when none is specified.
The formater returns the first element of the path suffixed with a / when there are multiple elements.
func HTTPHandler ¶
func HTTPHandler(h http.Handler, pathFormatters ...PathFormater) http.Handler
Returns an HTTP handler that generates metrics for the given handler.
func HTTPTransport ¶
func HTTPTransport(t http.RoundTripper, pathFormatters ...PathFormater) http.RoundTripper
Return an HTTP transport that generates metrics for the given transport.
func Middleware ¶
func Middleware(pathFormatters ...PathFormater) func(h http.Handler) http.Handler
Middleware return middleware for go-chi like http router
Types ¶
type PathFormater ¶
A function that formats a path.
When dealing with metrics, each different path adds a dimension that has a toll on metrics size and aggregation performances.
This is to prevent paths like the ones which include identifiers to over create metrics dimensions.
Click to show internal directories.
Click to hide internal directories.