var once … var controllerInstanceCount … type ControllerManagerMetrics … // NewControllerManagerMetrics create a new ControllerManagerMetrics, with specific manager name. func NewControllerManagerMetrics(manager string) *ControllerManagerMetrics { … } // Register controller manager metrics. func Register() { … } // ControllerStarted sets the controllerInstanceCount to 1. // These values use set instead of inc/dec to avoid accidentally double counting // a controller that starts but fails to properly signal when it crashes. func (a *ControllerManagerMetrics) ControllerStarted(name string) { … } // ControllerStopped sets the controllerInstanceCount to 0. func (a *ControllerManagerMetrics) ControllerStopped(name string) { … }