Skip to content

Commit

Permalink
fix(monitor): use prometheus client instead of k8s legacyregistry
Browse files Browse the repository at this point in the history
Signed-off-by: Feng Kun <[email protected]>
  • Loading branch information
kevinfeng authored and tke-robot committed Jul 8, 2020
1 parent 98b4e6c commit 04b881d
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 626 deletions.
4 changes: 2 additions & 2 deletions pkg/controller/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
package controller

import (
"github.com/prometheus/client_golang/prometheus/promhttp"
"k8s.io/apimachinery/pkg/runtime"
genericapifilters "k8s.io/apiserver/pkg/endpoints/filters"
apirequest "k8s.io/apiserver/pkg/endpoints/request"
Expand All @@ -28,7 +29,6 @@ import (
"k8s.io/apiserver/pkg/server/mux"
"k8s.io/apiserver/pkg/server/routes"
componentconfig "k8s.io/component-base/config"
"k8s.io/component-base/metrics/legacyregistry"
"net/http"
goruntime "runtime"
)
Expand Down Expand Up @@ -61,7 +61,7 @@ func NewBaseHandler(c *componentconfig.DebuggingConfiguration, checks ...healthz
goruntime.SetBlockProfileRate(1)
}
}
m.Handle("/metrics", legacyregistry.Handler())
m.Handle("/metrics", promhttp.Handler())

return m
}
Loading

0 comments on commit 04b881d

Please sign in to comment.