fix datasource prometheus metrics not being registered
@@ -108,12 +108,6 @@ func runCrowdsec(cConfig *csconfig.Config, parsers *parser.Parsers) error {
return nil
})
outputWg.Wait()
- log.Warningf("Starting processing data")
-
- if err := acquisition.StartAcquisition(dataSources, inputLineChan, &acquisTomb); err != nil {
- log.Fatalf("starting acquisition error : %s", err)
- return err
- }
if cConfig.Prometheus != nil && cConfig.Prometheus.Enabled {
aggregated := false
@@ -125,6 +119,12 @@ func runCrowdsec(cConfig *csconfig.Config, parsers *parser.Parsers) error {
}
}
+ log.Warningf("Starting processing data")
+
+ if err := acquisition.StartAcquisition(dataSources, inputLineChan, &acquisTomb); err != nil {
+ log.Fatalf("starting acquisition error : %s", err)
+ return err
+ }
return nil
}
