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.
Click to show internal directories.
Click to hide internal directories.