Add promehteus metric about leader election status

This commit is contained in:
Manuel Alejandro de Brito Fontes 2019-03-10 19:12:33 -03:00
parent 476d0106d6
commit 7c717cabcf
No known key found for this signature in database
GPG key ID: 786136016A8BA02A
4 changed files with 42 additions and 0 deletions

View file

@ -269,8 +269,12 @@ func (n *NGINXController) Start() {
if n.syncStatus != nil {
go n.syncStatus.Run(stopCh)
}
n.metricCollector.OnStartedLeading(n.cfg.ElectionID)
},
OnStoppedLeading: func() {
n.metricCollector.OnStoppedLeading(n.cfg.ElectionID)
// Remove prometheus metrics related to SSL certificates
srvs := sets.NewString()
for _, s := range n.runningConfig.Servers {