Skip to content

Commit

Permalink
use controller runtime metrics registry (kubeflow#4683)
Browse files Browse the repository at this point in the history
  • Loading branch information
kunmingg authored and k8s-ci-robot committed Jan 23, 2020
1 parent 251542a commit 34aa47c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 4 additions & 3 deletions components/profile-controller/controllers/moniotring.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package controllers

import (
"sigs.k8s.io/controller-runtime/pkg/metrics"
"time"

"github.com/prometheus/client_golang/prometheus"
Expand Down Expand Up @@ -44,9 +45,9 @@ var (

func init() {
// Register prometheus counters
prometheus.MustRegister(requestCounter)
prometheus.MustRegister(requestErrorCounter)
prometheus.MustRegister(serviceHeartbeat)
metrics.Registry.MustRegister(requestCounter)
metrics.Registry.MustRegister(requestErrorCounter)
metrics.Registry.MustRegister(serviceHeartbeat)
// Count heartbeat
go func() {
labels := prometheus.Labels{COMPONENT: PROFILE, SEVERITY: SEVERITY_CRITICAL}
Expand Down
3 changes: 2 additions & 1 deletion components/profile-controller/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ require (
github.com/go-logr/logr v0.1.0
github.com/onsi/ginkgo v1.8.0
github.com/onsi/gomega v1.5.0
github.com/prometheus/client_golang v0.9.0
github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e
github.com/sirupsen/logrus v1.4.2 // indirect
github.com/sirupsen/logrus v1.4.2
golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45
google.golang.org/api v0.10.0
Expand Down

0 comments on commit 34aa47c

Please sign in to comment.