forked from Ivasoft/traefik
prometheus: fixing prom Handler to use the custom registry
Co-authored-by: Jean-Baptiste Doumenjou <925513+jbdoumenjou@users.noreply.github.com>
This commit is contained in:
@@ -65,7 +65,9 @@ type PrometheusHandler struct{}
|
||||
|
||||
// AddRoutes adds Prometheus routes on a router.
|
||||
func (h PrometheusHandler) AddRoutes(router *mux.Router) {
|
||||
router.Methods(http.MethodGet).Path("/metrics").Handler(promhttp.Handler())
|
||||
router.Methods(http.MethodGet).Path("/metrics").Handler(
|
||||
promhttp.HandlerFor(promRegistry, promhttp.HandlerOpts{}),
|
||||
)
|
||||
}
|
||||
|
||||
// RegisterPrometheus registers all Prometheus metrics.
|
||||
|
||||
Reference in New Issue
Block a user