internal

package
v0.0.0-...-018885d Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2023 License: MIT Imports: 8 Imported by: 0

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

func MetricsInterceptor(name string, pr MetricsURLRewriter) Interceptor

type MetricsURLRewriter

type MetricsURLRewriter func(u url.URL) string

type ResponseHandler

type ResponseHandler func(resp *http.Response, err error)

func LogInterceptor

func LogInterceptor(r *http.Request) (*http.Request, ResponseHandler)

Jump to

Keyboard shortcuts

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