Merge pull request #2874 from aledbf/fix-status

Delay initial prometheus status metric
This commit is contained in:
k8s-ci-robot 2018-07-30 07:56:57 -07:00 committed by GitHub
commit c921a00abf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -18,6 +18,7 @@ package metric
import (
"os"
"time"
"github.com/prometheus/client_golang/prometheus"
@ -113,7 +114,12 @@ func (c *collector) Start() {
c.registry.MustRegister(c.ingressController)
c.registry.MustRegister(c.socket)
go c.nginxStatus.Start()
// the default nginx.conf does not contains
// a server section with the status port
go func() {
time.Sleep(5 * time.Second)
c.nginxStatus.Start()
}()
go c.nginxProcess.Start()
go c.socket.Start()
}