fix datasource prometheus metrics not being registered (#927)

This commit is contained in:
blotus 2021-09-02 12:35:12 +02:00 committed by GitHub
parent 589cb72d41
commit ea640dfb6d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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
}