From b0560fe8c7399a7492a95b64713bb6d4ceef590c Mon Sep 17 00:00:00 2001 From: SAY-5 Date: Wed, 22 Apr 2026 14:37:52 -0700 Subject: [PATCH] controller/metrics: drop MetricsAll from the default GoCollector The PR that switched the default GoCollector to collectors.WithGoCollectorRuntimeMetrics(collectors.MetricsAll) exposes every runtime/metrics path and ballooned Prometheus cardinality roughly 5x (31 -> 142 go_* series per pod on an unchanged daemonset controller bumping v0.19.7 -> v0.23.1). That change was reverted on release-0.19 and release-0.20 after users hit per-project metric quotas, but the revert never got forward-ported to 0.21+, so every release from v0.21 onward carries the cardinality regression. Restore the conservative default. Operators who want the extra runtime metrics can still register their own GoCollector with MetricsAll on ctrlmetrics.Registry themselves. Refs issue 3505. Signed-off-by: SAY-5 --- pkg/internal/controller/metrics/metrics.go | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/pkg/internal/controller/metrics/metrics.go b/pkg/internal/controller/metrics/metrics.go index 39b435c453..ad3461b04d 100644 --- a/pkg/internal/controller/metrics/metrics.go +++ b/pkg/internal/controller/metrics/metrics.go @@ -103,7 +103,17 @@ func init() { ReconcileTimeouts, // expose process metrics like CPU, Memory, file descriptor usage etc. collectors.NewProcessCollector(collectors.ProcessCollectorOpts{}), - // expose all Go runtime metrics like GC stats, memory stats etc. - collectors.NewGoCollector(collectors.WithGoCollectorRuntimeMetrics(collectors.MetricsAll)), + // expose the default Go runtime metrics (GC stats, memory + // stats, etc.). The collectors.MetricsAll variant this + // previously used balloons cardinality roughly 5x: a v0.19 + // -> v0.23 bump took an unchanged daemonset controller + // from ~31 go_* series per pod to ~142, enough to blow past + // per-project metric quotas. The opt-out was reverted on the + // 0.19 / 0.20 release branches via #3147 / #3148 but the + // revert was never forward-ported to 0.21+. Restore the + // conservative default; operators who want the extra + // metrics can register their own GoCollector with MetricsAll + // on the Registry themselves (#3505). + collectors.NewGoCollector(), ) }