diff --git a/pkg/cache/notifications.go b/pkg/cache/notifications.go index 8661d4170..4a628ee93 100644 --- a/pkg/cache/notifications.go +++ b/pkg/cache/notifications.go @@ -4,22 +4,8 @@ import ( "sync" "k8s.io/klog/v2" - - "github.com/prometheus/client_golang/prometheus" -) - -var notificationUsage = prometheus.NewCounterVec( - prometheus.CounterOpts{ - Name: "pod_identity_cache_notifications", - Help: "Counter of SA notifications", - }, - []string{"method"}, ) -func init() { - prometheus.MustRegister(notificationUsage) -} - type notifications struct { handlers map[string]chan struct{} mu sync.Mutex @@ -37,12 +23,10 @@ func (n *notifications) create(req Request) <-chan struct{} { n.mu.Lock() defer n.mu.Unlock() - notificationUsage.WithLabelValues("used").Inc() notifier, found := n.handlers[req.CacheKey()] if !found { notifier = make(chan struct{}) n.handlers[req.CacheKey()] = notifier - notificationUsage.WithLabelValues("created").Inc() n.fetchRequests <- &req } return notifier @@ -53,7 +37,6 @@ func (n *notifications) broadcast(key string) { defer n.mu.Unlock() if handler, found := n.handlers[key]; found { klog.V(5).Infof("Notifying handlers for %q", key) - notificationUsage.WithLabelValues("broadcast").Inc() close(handler) delete(n.handlers, key) }