Revert "prometheus: active worker gauge"

This reverts commit 68bc8e0c88.
This commit is contained in:
Sanne Raymaekers 2024-05-30 15:07:52 +02:00
parent 55439fc6d3
commit 4bb61da37e
2 changed files with 0 additions and 26 deletions

View file

@ -1,23 +0,0 @@
package prometheus
import (
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
)
var (
ActiveWorkers = promauto.NewGaugeVec(prometheus.GaugeOpts{
Name: "active_workers",
Namespace: Namespace,
Subsystem: WorkerSubsystem,
Help: "Active workers",
}, []string{"worker", "tenant", "arch"})
)
func AddActiveWorker(worker, tenant, arch string) {
ActiveWorkers.WithLabelValues(worker, tenant, arch).Inc()
}
func RemoveActiveWorker(worker, tenant, arch string) {
ActiveWorkers.WithLabelValues(worker, tenant, arch).Dec()
}

View file

@ -168,9 +168,7 @@ func (s *Server) WatchWorkers() {
err = s.jobs.DeleteWorker(w.ID)
if err != nil {
logrus.Warningf("Unable to remove worker: %v", err)
continue
}
prometheus.RemoveActiveWorker(w.ID.String(), w.Channel, w.Arch)
}
}
}
@ -830,7 +828,6 @@ func (s *Server) RegisterWorker(c, a string) (uuid.UUID, error) {
if err != nil {
return uuid.Nil, err
}
prometheus.AddActiveWorker(workerID.String(), c, a)
logrus.Infof("Worker (%v) registered", a)
return workerID, nil
}