mirror of
https://github.com/kubernetes-sigs/prometheus-adapter.git
synced 2026-04-05 17:27:51 +00:00
Merge branch 'master' into instrument-metrics
This commit is contained in:
commit
28cd9fdb09
1 changed files with 4 additions and 1 deletions
|
|
@ -44,6 +44,7 @@ var (
|
|||
Buckets: prometheus.DefBuckets,
|
||||
},
|
||||
[]string{"path", "server"},
|
||||
|
||||
)
|
||||
|
||||
// define a counter for API errors for various ErrorTypes
|
||||
|
|
@ -55,12 +56,14 @@ var (
|
|||
Help: "Total number of API errors",
|
||||
},
|
||||
[]string{"error_code", "path", "server"},
|
||||
|
||||
)
|
||||
)
|
||||
|
||||
func MetricsHandler() (http.HandlerFunc, error) {
|
||||
registry := metrics.NewKubeRegistry()
|
||||
|
||||
|
||||
errRegisterQueryLatency := registry.Register(queryLatency)
|
||||
if errRegisterQueryLatency != nil {
|
||||
return nil, errRegisterQueryLatency
|
||||
|
|
@ -70,7 +73,7 @@ func MetricsHandler() (http.HandlerFunc, error) {
|
|||
if errRegisterAPIErrorCount != nil {
|
||||
return nil, errRegisterAPIErrorCount
|
||||
}
|
||||
|
||||
|
||||
apimetrics.Register()
|
||||
return func(w http.ResponseWriter, req *http.Request) {
|
||||
legacyregistry.Handler().ServeHTTP(w, req)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue