mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-03-03 17:16:37 +00:00
feat: Remove init functions from collectors
Behaviour of init functions has been centralised in `collector/init.go`, and can be called during exporter startup. This allows the exporter to control the timing of collector initialisation, rather than relying on the import & `init()` method. This should reduce unexpected behaviour arising from the use of `init()`, such as #551. Signed-off-by: Ben Reedy <breed808@breed808.com>
This commit is contained in:
@@ -8,10 +8,6 @@ import (
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
)
|
||||
|
||||
func init() {
|
||||
registerCollector("cache", newCacheCollector, "Cache")
|
||||
}
|
||||
|
||||
// A CacheCollector is a Prometheus collector for Perflib Cache metrics
|
||||
type CacheCollector struct {
|
||||
AsyncCopyReadsTotal *prometheus.Desc
|
||||
|
||||
Reference in New Issue
Block a user