Add promehteus metric about leader election status
This commit is contained in:
parent
476d0106d6
commit
7c717cabcf
4 changed files with 42 additions and 0 deletions
|
|
@ -36,6 +36,9 @@ type Collector interface {
|
|||
IncReloadCount()
|
||||
IncReloadErrorCount()
|
||||
|
||||
OnStartedLeading(string)
|
||||
OnStoppedLeading(string)
|
||||
|
||||
RemoveMetrics(ingresses, endpoints []string)
|
||||
|
||||
SetSSLExpireTime([]*ingress.Server)
|
||||
|
|
@ -147,3 +150,13 @@ func (c *collector) SetSSLExpireTime(servers []*ingress.Server) {
|
|||
func (c *collector) SetHosts(hosts sets.String) {
|
||||
c.socket.SetHosts(hosts)
|
||||
}
|
||||
|
||||
// OnStartedLeading indicates the pod is not the current leader
|
||||
func (c *collector) OnStartedLeading(electionID string) {
|
||||
c.ingressController.OnStartedLeading(electionID)
|
||||
}
|
||||
|
||||
// OnStoppedLeading indicates the pod is not the current leader
|
||||
func (c *collector) OnStoppedLeading(electionID string) {
|
||||
c.ingressController.OnStoppedLeading(electionID)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue