From 5e13de4a6559033f5b6d2d31449d37333e6c2d08 Mon Sep 17 00:00:00 2001 From: Manuel de Brito Fontes Date: Mon, 30 Jul 2018 09:56:09 -0400 Subject: [PATCH] Delay initial prometheus status metric --- internal/ingress/metric/main.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/internal/ingress/metric/main.go b/internal/ingress/metric/main.go index 12cf0b11e..c63c89156 100644 --- a/internal/ingress/metric/main.go +++ b/internal/ingress/metric/main.go @@ -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() }