From ed8a585f3b9b14a9a8482fcfabcb44dcdf62a0ce Mon Sep 17 00:00:00 2001 From: modulitos Date: Thu, 14 Nov 2024 14:06:16 -0800 Subject: [PATCH] cleanup metrics --- pkg/cache/notifications.go | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/pkg/cache/notifications.go b/pkg/cache/notifications.go index 8661d417..4a628ee9 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) }