use official way of getting metrics for acquisition
This commit is contained in:
parent
aa02a00fc2
commit
91a6263b5b
|
@ -12,7 +12,6 @@ import (
|
||||||
"github.com/crowdsecurity/go-cs-lib/trace"
|
"github.com/crowdsecurity/go-cs-lib/trace"
|
||||||
"github.com/crowdsecurity/go-cs-lib/version"
|
"github.com/crowdsecurity/go-cs-lib/version"
|
||||||
|
|
||||||
appsec "github.com/crowdsecurity/crowdsec/pkg/acquisition/modules/appsec"
|
|
||||||
v1 "github.com/crowdsecurity/crowdsec/pkg/apiserver/controllers/v1"
|
v1 "github.com/crowdsecurity/crowdsec/pkg/apiserver/controllers/v1"
|
||||||
"github.com/crowdsecurity/crowdsec/pkg/cache"
|
"github.com/crowdsecurity/crowdsec/pkg/cache"
|
||||||
"github.com/crowdsecurity/crowdsec/pkg/csconfig"
|
"github.com/crowdsecurity/crowdsec/pkg/csconfig"
|
||||||
|
@ -163,8 +162,6 @@ func registerPrometheus(config *csconfig.PrometheusCfg) {
|
||||||
v1.LapiRouteHits,
|
v1.LapiRouteHits,
|
||||||
leaky.BucketsCurrentCount,
|
leaky.BucketsCurrentCount,
|
||||||
cache.CacheMetrics, exprhelpers.RegexpCacheMetrics,
|
cache.CacheMetrics, exprhelpers.RegexpCacheMetrics,
|
||||||
appsec.AppsecGlobalParsingHistogram, appsec.AppsecReqCounter, appsec.AppsecRuleHits,
|
|
||||||
appsec.AppsecBlockCounter,
|
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
log.Infof("Loading prometheus collectors")
|
log.Infof("Loading prometheus collectors")
|
||||||
|
@ -175,7 +172,6 @@ func registerPrometheus(config *csconfig.PrometheusCfg) {
|
||||||
leaky.BucketsPour, leaky.BucketsUnderflow, leaky.BucketsCanceled, leaky.BucketsInstantiation, leaky.BucketsOverflow, leaky.BucketsCurrentCount,
|
leaky.BucketsPour, leaky.BucketsUnderflow, leaky.BucketsCanceled, leaky.BucketsInstantiation, leaky.BucketsOverflow, leaky.BucketsCurrentCount,
|
||||||
globalActiveDecisions, globalAlerts,
|
globalActiveDecisions, globalAlerts,
|
||||||
cache.CacheMetrics, exprhelpers.RegexpCacheMetrics,
|
cache.CacheMetrics, exprhelpers.RegexpCacheMetrics,
|
||||||
appsec.AppsecGlobalParsingHistogram, appsec.AppsecInbandParsingHistogram, appsec.AppsecOutbandParsingHistogram, appsec.AppsecReqCounter, appsec.AppsecRuleHits, appsec.AppsecBlockCounter,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -139,11 +139,11 @@ func (wc *AppsecSource) UnmarshalConfig(yamlConfig []byte) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (w *AppsecSource) GetMetrics() []prometheus.Collector {
|
func (w *AppsecSource) GetMetrics() []prometheus.Collector {
|
||||||
return nil
|
return []prometheus.Collector{AppsecReqCounter, AppsecBlockCounter, AppsecRuleHits, AppsecOutbandParsingHistogram, AppsecInbandParsingHistogram, AppsecGlobalParsingHistogram}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (w *AppsecSource) GetAggregMetrics() []prometheus.Collector {
|
func (w *AppsecSource) GetAggregMetrics() []prometheus.Collector {
|
||||||
return nil
|
return []prometheus.Collector{AppsecReqCounter, AppsecBlockCounter, AppsecRuleHits, AppsecOutbandParsingHistogram, AppsecInbandParsingHistogram, AppsecGlobalParsingHistogram}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (w *AppsecSource) Configure(yamlConfig []byte, logger *log.Entry) error {
|
func (w *AppsecSource) Configure(yamlConfig []byte, logger *log.Entry) error {
|
||||||
|
|
Loading…
Reference in a new issue