forked from Ivasoft/traefik
Split Web into API/Dashboard, ping, metric and Rest Provider
This commit is contained in:
committed by
Traefiker
parent
384488ac02
commit
27d1b46835
@@ -1,9 +1,11 @@
|
||||
package metrics
|
||||
|
||||
import (
|
||||
"github.com/containous/mux"
|
||||
"github.com/containous/traefik/types"
|
||||
"github.com/go-kit/kit/metrics/prometheus"
|
||||
stdprometheus "github.com/prometheus/client_golang/prometheus"
|
||||
"github.com/prometheus/client_golang/prometheus/promhttp"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -14,6 +16,14 @@ const (
|
||||
retriesTotalName = metricNamePrefix + "backend_retries_total"
|
||||
)
|
||||
|
||||
// PrometheusHandler expose Prometheus routes
|
||||
type PrometheusHandler struct{}
|
||||
|
||||
// AddRoutes add Prometheus routes on a router
|
||||
func (h PrometheusHandler) AddRoutes(router *mux.Router) {
|
||||
router.Methods("GET").Path("/metrics").Handler(promhttp.Handler())
|
||||
}
|
||||
|
||||
// RegisterPrometheus registers all Prometheus metrics.
|
||||
// It must be called only once and failing to register the metrics will lead to a panic.
|
||||
func RegisterPrometheus(config *types.Prometheus) Registry {
|
||||
|
||||
Reference in New Issue
Block a user