Documentation ¶
Index ¶
- Constants
- type Target
- func (t *Target) Duration() func(handler http.Handler) http.Handler
- func (t *Target) DurationMetric() prometheus.Collector
- func (t *Target) StatusCount() func(handler http.Handler) http.Handler
- func (t *Target) StatusCountMetric() prometheus.Collector
- func (t *Target) VisitCount() func(handler http.Handler) http.Handler
- func (t *Target) VisitCountMetric() prometheus.Collector
Constants ¶
const ( LabelService = "service" LabelPath = "path" LabelMethod = "method" LabelStatus = "status" )
Common labels used.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Target ¶
Target describes the service that is exposing the metrics.
func (*Target) Duration ¶
Duration returns an HTTP middleware that records the request duration per HTTP method and path. Multiple calls of Duration on the same Target will only register the metric once.
func (*Target) DurationMetric ¶
func (t *Target) DurationMetric() prometheus.Collector
DurationMetric exposes the internal duration metric. It may or may not have been initialized.
func (*Target) StatusCount ¶
StatusCount returns an HTTP handler that counts the occurrence of status code per path, method and status. Multiple calls to StatusCount will only initialize the metric once.
func (*Target) StatusCountMetric ¶
func (t *Target) StatusCountMetric() prometheus.Collector
StatusCountMetric exposes the status count metric. It may or may not have been initialized.
func (*Target) VisitCount ¶
VisitCount returns an HTTP middleware that keeps track of the number of times the endpoint is visited per path and method. Multiple calls to VisitCount will only initialize the metric once.
func (*Target) VisitCountMetric ¶
func (t *Target) VisitCountMetric() prometheus.Collector
VisitCountMetric exposes the visit count metric. It may or may not have been initialized.