Skip to content

Commit 1584a52

Browse files
committed
Remove unneeded metrics and add cool log line
1 parent eb3a811 commit 1584a52

File tree

2 files changed

+1
-27
lines changed

2 files changed

+1
-27
lines changed

components/node-labeler/cmd/metrics.go

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,4 @@ var (
2626
Help: "time it took for a pods to reach the running phase and the ready label was applied to the node",
2727
Buckets: []float64{5, 10, 15, 20, 25, 30, 45, 60, 75},
2828
}, []string{"component"})
29-
30-
// Track reconciliation durations for the NodeScaledownAnnotationController
31-
NodeScaledownAnnotationReconcileDuration = prometheus.NewHistogramVec(prometheus.HistogramOpts{
32-
Namespace: metricsNamespace,
33-
Subsystem: metricsWorkspaceSubsystem,
34-
Name: "node_scaledown_annotation_reconcile_duration_seconds",
35-
Help: "Duration of NodeScaledownAnnotationController reconciliations",
36-
Buckets: []float64{0.1, 0.5, 1, 2.5, 5, 10, 30},
37-
}, []string{"operation"})
38-
39-
// Track queue size for the NodeScaledownAnnotationController
40-
NodeScaledownAnnotationReconciliationQueueSize = prometheus.NewGauge(prometheus.GaugeOpts{
41-
Namespace: metricsNamespace,
42-
Subsystem: metricsWorkspaceSubsystem,
43-
Name: "node_scaledown_annotation_reconciliation_queue_size",
44-
Help: "Current size of the NodeScaledownAnnotationController reconciliation queue",
45-
})
4629
)

components/node-labeler/cmd/run.go

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import (
1616

1717
"github.com/bombsimon/logrusr/v2"
1818
workspacev1 "github.com/gitpod-io/gitpod/ws-manager/api/crd/v1"
19-
"github.com/prometheus/client_golang/prometheus"
2019
"github.com/spf13/cobra"
2120
corev1 "k8s.io/api/core/v1"
2221
"k8s.io/apimachinery/pkg/api/errors"
@@ -146,8 +145,6 @@ var runCmd = &cobra.Command{
146145

147146
metrics.Registry.MustRegister(NodeLabelerCounterVec)
148147
metrics.Registry.MustRegister(NodeLabelerTimeHistVec)
149-
metrics.Registry.MustRegister(NodeScaledownAnnotationReconcileDuration)
150-
metrics.Registry.MustRegister(NodeScaledownAnnotationReconciliationQueueSize)
151148

152149
err = mgr.AddHealthzCheck("healthz", healthz.Ping)
153150
if err != nil {
@@ -328,6 +325,7 @@ func (c *NodeScaledownAnnotationController) periodicReconciliation() {
328325
log.WithError(err).Error("periodic reconciliation failed")
329326
}
330327
case <-c.stopChan:
328+
log.Info("stopping periodic full reconciliation")
331329
return
332330
}
333331
}
@@ -394,7 +392,6 @@ func (c *NodeScaledownAnnotationController) queueNodeForReconciliation(nodeName
394392
default:
395393
log.WithField("node", nodeName).Warn("reconciliation queue full")
396394
}
397-
NodeScaledownAnnotationReconciliationQueueSize.Set(float64(len(c.nodesToReconcile)))
398395
}
399396

400397
func (c *NodeScaledownAnnotationController) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
@@ -422,9 +419,6 @@ func (wc *NodeScaledownAnnotationController) Stop() {
422419
}
423420

424421
func (c *NodeScaledownAnnotationController) reconcileAllNodes(ctx context.Context) (ctrl.Result, error) {
425-
timer := prometheus.NewTimer(NodeScaledownAnnotationReconcileDuration.WithLabelValues("all_nodes"))
426-
defer timer.ObserveDuration()
427-
428422
var nodes corev1.NodeList
429423
if err := c.List(ctx, &nodes); err != nil {
430424
log.WithError(err).Error("failed to list nodes")
@@ -439,9 +433,6 @@ func (c *NodeScaledownAnnotationController) reconcileAllNodes(ctx context.Contex
439433
}
440434

441435
func (c *NodeScaledownAnnotationController) reconcileNode(ctx context.Context, nodeName string) error {
442-
timer := prometheus.NewTimer(NodeScaledownAnnotationReconcileDuration.WithLabelValues("node"))
443-
defer timer.ObserveDuration()
444-
445436
var workspaceList workspacev1.WorkspaceList
446437
if err := c.List(ctx, &workspaceList, client.MatchingFields{
447438
"status.runtime.nodeName": nodeName,

0 commit comments

Comments
 (0)