Documentation
¶
Index ¶
- func WithDefaultLatencyHistogram() option
- func WithDefaultRequestCounter() option
- func WithLatencyHistogram(name string, buckets []float64) option
- func WithNamespace(namespace string) option
- func WithRequestCounter(name string) option
- func WithSkipFunc(skipFunc SkipFunc) option
- func WithSubsystem(name string) option
- type Middleware
- type SkipFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithDefaultLatencyHistogram ¶
func WithDefaultLatencyHistogram() option
WithDefaultLatencyHistogram creates a latency histogram collector with the name `request_duration_seconds`
func WithDefaultRequestCounter ¶
func WithDefaultRequestCounter() option
WithDefaultRequestCounter creates a request counter with the default name `requests_total`
func WithLatencyHistogram ¶
WithLatencyHistogram creates a latency histogram collector with a given name
func WithNamespace ¶
func WithNamespace(namespace string) option
WithNamespace sets the namespace of the prometheus collectors
func WithRequestCounter ¶
func WithRequestCounter(name string) option
WithRequestCounter creates a new request counter collector with a given name
func WithSkipFunc ¶
func WithSkipFunc(skipFunc SkipFunc) option
func WithSubsystem ¶
func WithSubsystem(name string) option
WithSubsystem sets the subsystem of the prometheus collectors
Types ¶
type Middleware ¶
Middleware is responsible for creating a middleware handler func
func Default ¶
func Default() Middleware
Default creates a new middleware with default collectors attached
func New ¶
func New(options ...option) Middleware
New creates a new prometheus middleware from given options. Note: the middleware has no prometheus collectors attached per default. If you want the default collectors, use Default