Allow to disable NGINX metrics
This commit is contained in:
parent
c4ba23832a
commit
06d33c16b5
9 changed files with 42 additions and 9 deletions
|
|
@ -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()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue