Merge pull request #41807 from shyamjvs/remove-fart-metrics

Automatic merge from submit-queue (batch tested with PRs 41797, 41793, 41795, 41807, 41781)

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

Unregister metrics we do not want from the etcd version metrics handler.

cc @wojtek-t @piosz
This commit is contained in:
Kubernetes Submit Queue 2017-02-22 22:06:35 -08:00 committed by GitHub
commit 8fc311c96c

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))
}