From 7e01cfb8b1db7a4246200c5e45dc4659a23653a2 Mon Sep 17 00:00:00 2001 From: Nick Tran <10810510+njtran@users.noreply.github.com> Date: Mon, 16 Oct 2023 12:41:38 -0700 Subject: [PATCH] fix: add in v1beta1 termination metrics label (#606) --- pkg/controllers/node/termination/controller.go | 1 + pkg/controllers/node/termination/metrics.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/controllers/node/termination/controller.go b/pkg/controllers/node/termination/controller.go index eba14d64c2dd..20128ffd45de 100644 --- a/pkg/controllers/node/termination/controller.go +++ b/pkg/controllers/node/termination/controller.go @@ -148,6 +148,7 @@ func (c *Controller) removeFinalizer(ctx context.Context, n *v1.Node) error { // We use stored.DeletionTimestamp since the api-server may give back a node after the patch without a deletionTimestamp TerminationSummary.With(prometheus.Labels{ metrics.ProvisionerLabel: n.Labels[v1alpha5.ProvisionerNameLabelKey], + metrics.NodePoolLabel: n.Labels[v1beta1.NodePoolLabelKey], }).Observe(time.Since(stored.DeletionTimestamp.Time).Seconds()) logging.FromContext(ctx).Infof("deleted node") } diff --git a/pkg/controllers/node/termination/metrics.go b/pkg/controllers/node/termination/metrics.go index e6135787408c..538095265e5e 100644 --- a/pkg/controllers/node/termination/metrics.go +++ b/pkg/controllers/node/termination/metrics.go @@ -30,7 +30,7 @@ var ( Help: "The time taken between a node's deletion request and the removal of its finalizer", Objectives: metrics.SummaryObjectives(), }, - []string{metrics.ProvisionerLabel}, + []string{metrics.ProvisionerLabel, metrics.NodePoolLabel}, ) )