ctrlqueue

package
v0.0.0-...-2ea7058 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 4, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewQueue

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

NewAddsMetric implements workqueue.MetricsProvider.

func (NoopMetricsProvider) NewDepthMetric

NewDepthMetric implements workqueue.MetricsProvider.

func (NoopMetricsProvider) NewLatencyMetric

NewLatencyMetric implements workqueue.MetricsProvider.

func (NoopMetricsProvider) NewLongestRunningProcessorSecondsMetric

func (NoopMetricsProvider) NewLongestRunningProcessorSecondsMetric(string) workqueue.SettableGaugeMetric

NewLongestRunningProcessorSecondsMetric implements workqueue.MetricsProvider.

func (NoopMetricsProvider) NewRetriesMetric

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL