Documentation ¶
Index ¶
Constants ¶
const (
ControllerName = hivev1.MetricsControllerName
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Calculator ¶
type Calculator struct { Client client.Client // Interval is the length of time we sleep between metrics calculations. Interval time.Duration }
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 related to specific reconciliations.
type ReconcileObserver ¶
type ReconcileObserver struct {
// contains filtered or unexported fields
}
ReconcileObserver is used to track, log, and report metrics for controller reconcile time and outcome. Each controller should instantiate one near the start of the reconcile loop, and defer a call to ObserveControllerReconcileTime.
func NewReconcileObserver ¶
func NewReconcileObserver(controllerName hivev1.ControllerName, logger log.FieldLogger) *ReconcileObserver
func (*ReconcileObserver) ObserveControllerReconcileTime ¶
func (ro *ReconcileObserver) ObserveControllerReconcileTime()
type ReconcileOutcome ¶
type ReconcileOutcome string
ReconcileOutcome is used in controller "reconcile complete" log entries, and the metricControllerReconcileTime above for controllers where we would like to monitor performance for different types of Reconcile outcomes. To help with prometheus cardinality this set of outcomes should be kept small and only used for coarse and very high value categories. Controllers must report an outcome but can report unspecified if this categorization is not needed.
const ( ReconcileOutcomeUnspecified ReconcileOutcome = "unspecified" ReconcileOutcomeNoOp ReconcileOutcome = "no-op" ReconcileOutcomeSkippedSync ReconcileOutcome = "skipped-sync" ReconcileOutcomeFullSync ReconcileOutcome = "full-sync" ReconcileOutcomeClusterSyncCreated ReconcileOutcome = "clustersync-created" )