Documentation
¶
Overview ¶
Package ctrlqueue builds controller-runtime workqueues that keep no metrics, for components that do not export controller-runtime's workqueue_* series.
Why (issue #1131): every controller-runtime priority queue built with a name starts an updateUnfinishedWorkLoop goroutine that wakes every 500 ms for the life of the process to refresh two Prometheus gauges. A node agent runs one queue per controller (gamma, l4route ×3, capture, endpointpolicy, node taint, ...), so that is ~10 timer wakeups a second on an otherwise idle process, and on a node where the Go runtime's threads land on deep-idle CPUs each one is expensive. Nothing scrapes the agent's workqueue_* series (the chart exposes :8080 but no scrape job, dashboard or alert reads it; the agent's own metrics go out over OTLP), so the loops are pure overhead.
There is no manager-wide switch for this. The queue's metrics provider is not a manager option, and a no-op provider alone does not help: the priority queue starts the loop whenever its name is non-empty, whatever the provider. Only a queue with an empty name gets the no-metrics implementation and no loop, so NewQueue builds exactly that, and also passes NoopMetricsProvider so a future controller-runtime that keys the loop off the provider stays quiet too.
Index ¶
- func NewQueue(controllerName string, ...) workqueue.TypedRateLimitingInterface[reconcile.Request]
- func Options() controller.Options
- type NoopMetricsProvider
- func (NoopMetricsProvider) NewAddsMetric(string) workqueue.CounterMetric
- func (NoopMetricsProvider) NewDepthMetric(string) workqueue.GaugeMetric
- func (NoopMetricsProvider) NewLatencyMetric(string) workqueue.HistogramMetric
- func (NoopMetricsProvider) NewLongestRunningProcessorSecondsMetric(string) workqueue.SettableGaugeMetric
- func (NoopMetricsProvider) NewRetriesMetric(string) workqueue.CounterMetric
- func (NoopMetricsProvider) NewUnfinishedWorkSecondsMetric(string) workqueue.SettableGaugeMetric
- func (NoopMetricsProvider) NewWorkDurationMetric(string) workqueue.HistogramMetric
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewQueue ¶
func NewQueue(controllerName string, rateLimiter workqueue.TypedRateLimiter[reconcile.Request]) workqueue.TypedRateLimitingInterface[reconcile.Request]
NewQueue is a controller.Options.NewQueue that builds the same priority queue controller-runtime builds by default (same rate limiter, same per-controller logger), minus its metrics and their 500 ms refresh loop.
func Options ¶
func Options() controller.Options
Options returns controller options whose queue keeps no metrics. Callers that need other options set them on the returned value.
Types ¶
type NoopMetricsProvider ¶
type NoopMetricsProvider struct{}
NoopMetricsProvider is a workqueue.MetricsProvider whose metrics discard everything.
func (NoopMetricsProvider) NewAddsMetric ¶
func (NoopMetricsProvider) NewAddsMetric(string) workqueue.CounterMetric
NewAddsMetric implements workqueue.MetricsProvider.
func (NoopMetricsProvider) NewDepthMetric ¶
func (NoopMetricsProvider) NewDepthMetric(string) workqueue.GaugeMetric
NewDepthMetric implements workqueue.MetricsProvider.
func (NoopMetricsProvider) NewLatencyMetric ¶
func (NoopMetricsProvider) NewLatencyMetric(string) workqueue.HistogramMetric
NewLatencyMetric implements workqueue.MetricsProvider.
func (NoopMetricsProvider) NewLongestRunningProcessorSecondsMetric ¶
func (NoopMetricsProvider) NewLongestRunningProcessorSecondsMetric(string) workqueue.SettableGaugeMetric
NewLongestRunningProcessorSecondsMetric implements workqueue.MetricsProvider.
func (NoopMetricsProvider) NewRetriesMetric ¶
func (NoopMetricsProvider) NewRetriesMetric(string) workqueue.CounterMetric
NewRetriesMetric implements workqueue.MetricsProvider.
func (NoopMetricsProvider) NewUnfinishedWorkSecondsMetric ¶
func (NoopMetricsProvider) NewUnfinishedWorkSecondsMetric(string) workqueue.SettableGaugeMetric
NewUnfinishedWorkSecondsMetric implements workqueue.MetricsProvider.
func (NoopMetricsProvider) NewWorkDurationMetric ¶
func (NoopMetricsProvider) NewWorkDurationMetric(string) workqueue.HistogramMetric
NewWorkDurationMetric implements workqueue.MetricsProvider.