Remove unnecessary metrics (http/process/go) from being exposed by etcd-version-monitor

This commit is contained in:
Shyam Jeedigunta 2017-02-21 15:39:01 +01:00
parent e65ac460eb
commit d5a28b3618

View File

@ -218,7 +218,7 @@ func main() {
// Register the metrics we defined above with prometheus.
prometheus.MustRegister(etcdVersion)
prometheus.MustRegister(etcdGRPCRequestsTotal)
prometheus.Unregister(prometheus.NewGoCollector()) // Unregister go metrics.
prometheus.Unregister(prometheus.NewGoCollector())
// Spawn threads for periodically scraping etcd version metrics.
stopCh := make(chan struct{})
@ -228,6 +228,6 @@ func main() {
// Serve our metrics on listenAddress/metricsPath.
glog.Infof("Listening on: %v", listenAddress)
http.Handle(metricsPath, prometheus.Handler())
http.Handle(metricsPath, prometheus.UninstrumentedHandler())
glog.Errorf("Stopped listening/serving metrics: %v", http.ListenAndServe(listenAddress, nil))
}