mirror of
https://github.com/crowdsecurity/crowdsec.git
synced 2025-05-11 12:25:53 +02:00
acquisition : take prometheus level into account (#2885)
* properly take into account the aggregation level of prometheus metrics in acquisition
This commit is contained in:
parent
bd785ede15
commit
b1c09f7512
31 changed files with 245 additions and 128 deletions
|
@ -15,6 +15,7 @@ import (
|
|||
|
||||
"github.com/crowdsecurity/go-cs-lib/cstest"
|
||||
|
||||
"github.com/crowdsecurity/crowdsec/pkg/acquisition/configuration"
|
||||
"github.com/crowdsecurity/crowdsec/pkg/types"
|
||||
)
|
||||
|
||||
|
@ -75,7 +76,7 @@ group_id: crowdsec`,
|
|||
})
|
||||
for _, test := range tests {
|
||||
k := KafkaSource{}
|
||||
err := k.Configure([]byte(test.config), subLogger)
|
||||
err := k.Configure([]byte(test.config), subLogger, configuration.METRICS_NONE)
|
||||
cstest.AssertErrorContains(t, err, test.expectedErr)
|
||||
}
|
||||
}
|
||||
|
@ -169,7 +170,7 @@ func TestStreamingAcquisition(t *testing.T) {
|
|||
source: kafka
|
||||
brokers:
|
||||
- localhost:9092
|
||||
topic: crowdsecplaintext`), subLogger)
|
||||
topic: crowdsecplaintext`), subLogger, configuration.METRICS_NONE)
|
||||
if err != nil {
|
||||
t.Fatalf("could not configure kafka source : %s", err)
|
||||
}
|
||||
|
@ -245,7 +246,7 @@ tls:
|
|||
client_cert: ./testdata/kafkaClient.certificate.pem
|
||||
client_key: ./testdata/kafkaClient.key
|
||||
ca_cert: ./testdata/snakeoil-ca-1.crt
|
||||
`), subLogger)
|
||||
`), subLogger, configuration.METRICS_NONE)
|
||||
if err != nil {
|
||||
t.Fatalf("could not configure kafka source : %s", err)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue