Allow to disable NGINX metrics

This commit is contained in:
Manuel Alejandro de Brito Fontes 2018-12-04 16:59:54 -03:00
parent c4ba23832a
commit 06d33c16b5
No known key found for this signature in database
GPG key ID: 786136016A8BA02A
9 changed files with 42 additions and 9 deletions

View file

@ -128,9 +128,12 @@ func main() {
ReportErrors: true,
}))
mc, err := metric.NewCollector(conf.ListenPorts.Status, reg)
if err != nil {
glog.Fatalf("Error creating prometheus collector: %v", err)
mc := metric.NewDummyCollector()
if conf.EnableMetrics {
mc, err = metric.NewCollector(conf.ListenPorts.Status, reg)
if err != nil {
glog.Fatalf("Error creating prometheus collector: %v", err)
}
}
mc.Start()