Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( MetricClientReqDur = metric.NewHistogramVec(&metric.HistogramVecOpts{ Namespace: clientNamespace, Subsystem: "requests", Name: "duration_ms", Help: "http client requests duration(ms).", Labels: []string{"name", "method", "url"}, Buckets: []float64{0.25, 0.5, 1, 2, 5, 10, 25, 50, 100, 250, 500, 1000, 2000, 5000, 10000, 15000}, }) MetricClientReqCodeTotal = metric.NewCounterVec(&metric.CounterVecOpts{ Namespace: clientNamespace, Subsystem: "requests", Name: "code_total", Help: "http client requests code count.", Labels: []string{"name", "method", "url", "code"}, }) )
Functions ¶
This section is empty.
Types ¶
type Interceptor ¶
type Interceptor func(r *http.Request) (*http.Request, ResponseHandler)
func MetricsInterceptor ¶ added in v1.6.0
func MetricsInterceptor(name string, pr MetricsURLRewriter) Interceptor
type MetricsURLRewriter ¶ added in v1.6.0
type ResponseHandler ¶
func LogInterceptor ¶
func LogInterceptor(r *http.Request) (*http.Request, ResponseHandler)
Click to show internal directories.
Click to hide internal directories.