migrate kube-proxy metrics to stability framework

This commit is contained in:
Han Kang
2019-08-22 18:03:32 -07:00
parent 8b4fd4104d
commit 0895ac212d
12 changed files with 125 additions and 95 deletions

View File

@@ -22,6 +22,7 @@ import (
"errors"
"fmt"
"io/ioutil"
"k8s.io/component-base/metrics/legacyregistry"
"net/http"
"os"
goruntime "runtime"
@@ -74,7 +75,6 @@ import (
utilpointer "k8s.io/utils/pointer"
"github.com/fsnotify/fsnotify"
"github.com/prometheus/client_golang/prometheus"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
"k8s.io/klog"
@@ -549,7 +549,7 @@ func (s *ProxyServer) Run() error {
proxyMux.HandleFunc("/proxyMode", func(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "%s", s.ProxyMode)
})
proxyMux.Handle("/metrics", prometheus.Handler())
proxyMux.Handle("/metrics", legacyregistry.Handler())
if s.EnableProfiling {
routes.Profiling{}.Install(proxyMux)
}