From 6b047095a182a487db4d8bf76fc770dc0c0ccc6e Mon Sep 17 00:00:00 2001 From: Andreas Rammhold Date: Sat, 12 Mar 2016 22:42:49 +0100 Subject: [PATCH] Fixed gluon-collector crash if config is not valid gluon-collector would crash if the config could not be loaded. The cause of this is an access to config.Get('prometheus') without actually checking if the config is loaded before initializing prometheus. --- gluon-collector/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gluon-collector/main.go b/gluon-collector/main.go index 3694859..069d269 100644 --- a/gluon-collector/main.go +++ b/gluon-collector/main.go @@ -222,10 +222,10 @@ func main() { Closeables = make([]io.Closer, 0, 5) flag.Parse() conf.InitConfig() - prometheus.Init() if conf.Global == nil { log.Fatal("Configuration couldn't be parsed") } + prometheus.Init() ConfigureLogger() CreateDataStore() prometheus.ProcessStoredValues(DataStore)