Add nginx metrics to prometheus

This commit is contained in:
Manuel de Brito Fontes 2016-11-28 22:39:17 -03:00
parent 81cd7782c6
commit 86dbf979cb
8 changed files with 477 additions and 17 deletions

View file

@ -11,9 +11,9 @@ import (
"time"
"github.com/golang/glog"
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/spf13/pflag"
"github.com/prometheus/client_golang/prometheus"
"k8s.io/kubernetes/pkg/api"
clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset"
"k8s.io/kubernetes/pkg/client/restclient"
@ -161,7 +161,7 @@ func registerHandlers(enableProfiling bool, port int, ic *GenericController) {
ic.cfg.Backend,
)
mux.Handle("/metrics", prometheus.Handler())
mux.Handle("/metrics", promhttp.Handler())
mux.HandleFunc("/build", func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusOK)