Browse Source

etcdserver: update metrics to use promhttp

Update api/etcdhttp/metrics.go to use promhttp.Handler() instead of prometheus.Handler()

fixes #8729
tylerauerbeck 8 years ago
parent
commit
527d03e0d2
1 changed files with 3 additions and 3 deletions
  1. 3 3
      etcdserver/api/etcdhttp/metrics.go

+ 3 - 3
etcdserver/api/etcdhttp/metrics.go

@@ -24,7 +24,7 @@ import (
 	"github.com/coreos/etcd/etcdserver/etcdserverpb"
 	"github.com/coreos/etcd/raft"
 
-	"github.com/prometheus/client_golang/prometheus"
+	"github.com/prometheus/client_golang/prometheus/promhttp"
 )
 
 const (
@@ -34,13 +34,13 @@ const (
 
 // HandleMetricsHealth registers metrics and health handlers.
 func HandleMetricsHealth(mux *http.ServeMux, srv etcdserver.ServerV2) {
-	mux.Handle(pathMetrics, prometheus.Handler())
+	mux.Handle(pathMetrics, promhttp.Handler())
 	mux.Handle(PathHealth, NewHealthHandler(func() Health { return checkHealth(srv) }))
 }
 
 // HandlePrometheus registers prometheus handler on '/metrics'.
 func HandlePrometheus(mux *http.ServeMux) {
-	mux.Handle(pathMetrics, prometheus.Handler())
+	mux.Handle(pathMetrics, promhttp.Handler())
 }
 
 // HandleHealth registers health handler on '/health'.