Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // MetricControllerReconcileTime tracks the length of time our reconcile loops take. controller-runtime // technically tracks this for us, but due to bugs currently also includes time in the queue, which leads to // extremely strange results. For now, track our own metric. MetricControllerReconcileTime = prometheus.NewHistogramVec( prometheus.HistogramOpts{ Name: "cco_controller_reconcile_seconds", Help: "Distribution of the length of time each controllers reconcile loop takes.", Buckets: []float64{0.001, 0.01, 0.1, 1, 10, 30, 60, 120}, }, []string{"controller"}, ) )
Functions ¶
Types ¶
type Calculator ¶
type Calculator struct { Client client.Client // Interval is the length of time we sleep between metrics calculations. Interval time.Duration // contains filtered or unexported fields }
Calculator runs in a goroutine and periodically calculates and publishes Prometheus metrics which will be exposed at our /metrics endpoint. Note that this is not a standard controller watching Kube resources, it runs periodically and then goes to sleep.
This should be used for metrics which do not fit well into controller reconcile loops, things that are calculated globally rather than metrics releated to specific reconciliations.
Click to show internal directories.
Click to hide internal directories.