exthttp

package
v0.0.0-...-15a3f70 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMetricTripperware

func NewMetricTripperware(metrics *ClientMetrics, target string, next http.RoundTripper) promhttp.RoundTripperFunc

func NewMetricsMiddlewareHandler

func NewMetricsMiddlewareHandler(reg prometheus.Registerer, handlerName string, handler http.Handler) http.HandlerFunc

NewHandler wraps the given HTTP handler for instrumentation. It registers four metric collectors (if not already done) and reports HTTP metrics to the (newly or already) registered collectors: http_requests_total (CounterVec), http_request_duration_seconds (Histogram), http_request_size_bytes (Summary), http_response_size_bytes (Summary). Each has a constant label named "handler" with the provided handlerName as value. http_requests_total is a metric vector partitioned by HTTP method (label name "method") and HTTP status code (label name "code").

Types

type ClientMetrics

type ClientMetrics struct {
	// contains filtered or unexported fields
}

func NewClientMetrics

func NewClientMetrics(reg prometheus.Registerer) *ClientMetrics

NewClientMetrics provides ClientMetrics.

type ServerMetrics

type ServerMetrics struct {
	// contains filtered or unexported fields
}

func NewServerMetrics

func NewServerMetrics(reg prometheus.Registerer) *ServerMetrics

NewServerMetrics provides ServerMetrics.

Jump to

Keyboard shortcuts

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