Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // BodySizeBuckets defines buckets for request/response body sizes. BodySizeBuckets = []float64{1 * mb, 2.5 * mb, 5 * mb, 10 * mb, 25 * mb, 50 * mb, 100 * mb, 250 * mb} // DefBuckets are histogram buckets for the response time (in seconds) // of a network service, including one that is responding very slowly. DefBuckets = []float64{.005, .01, .025, .05, .1, .25, .5, 1, 2.5, 5, 10, 25, 50, 100} )
Functions ¶
func ExtractSampledTraceID ¶
ExtractSampledTraceID works like ExtractTraceID but the returned bool is only true if the returned trace id is sampled.
func ExtractTraceID ¶
ExtractTraceID extracts the trace id, if any from the context.
func MakeLabelValue ¶
MakeLabelValue converts a Gorilla mux path to a string suitable for use in a Prometheus label value.
Types ¶
type HTTPAuth ¶
type HTTPAuth struct {
// contains filtered or unexported fields
}
func NewHTTPAuth ¶
type HTTPFakeAuth ¶
type HTTPFakeAuth struct{}
type Instrument ¶
type Instrument struct {
// contains filtered or unexported fields
}
Instrument is a Middleware which records timings for every HTTP request
func NewInstrument ¶
func NewInstrument(routeMatcher RouteMatcher, defBuckets []float64, prefix string) (*Instrument, error)
type Interface ¶
Interface is the shared contract for all middleware, and allows middlewares to wrap handlers.
type Log ¶
type Log struct {
// contains filtered or unexported fields
}
func NewLoggingMiddleware ¶
type RequestLimits ¶
type RequestLimits struct {
// contains filtered or unexported fields
}
func NewRequestLimitsMiddleware ¶
func NewRequestLimitsMiddleware(maxRequestBodySize int64) *RequestLimits
type RouteMatcher ¶
type RouteMatcher interface {
Match(*http.Request, *mux.RouteMatch) bool
}
RouteMatcher matches routes
type Tracer ¶
type Tracer struct {
// contains filtered or unexported fields
}
Tracer is a middleware which traces incoming requests.
func NewTracer ¶
func NewTracer(routeMatcher RouteMatcher, tracer opentracing.Tracer) *Tracer
Click to show internal directories.
Click to hide internal directories.