diff --git a/collector/zfs.go b/collector/zfs.go index 67e7ca61..11b46fae 100644 --- a/collector/zfs.go +++ b/collector/zfs.go @@ -15,3 +15,7 @@ // +build !nozfs package collector + +func init() { + registerCollector("zfs", defaultEnabled, NewZFSCollector) +} diff --git a/collector/zfs_freebsd.go b/collector/zfs_freebsd.go index 65495781..76404766 100644 --- a/collector/zfs_freebsd.go +++ b/collector/zfs_freebsd.go @@ -30,10 +30,6 @@ const ( zfsCollectorSubsystem = "zfs" ) -func init() { - registerCollector("zfs", defaultEnabled, NewZfsCollector) -} - func NewZfsCollector(logger *slog.Logger) (Collector, error) { return &zfsCollector{ sysctls: []bsdSysctl{ diff --git a/collector/zfs_linux.go b/collector/zfs_linux.go index e4bbe7c3..c1ce284b 100644 --- a/collector/zfs_linux.go +++ b/collector/zfs_linux.go @@ -58,10 +58,6 @@ type zfsCollector struct { logger *slog.Logger } -func init() { - registerCollector("zfs", defaultEnabled, NewZFSCollector) -} - // NewZFSCollector returns a new Collector exposing ZFS statistics. func NewZFSCollector(logger *slog.Logger) (Collector, error) { return &zfsCollector{ diff --git a/collector/zfs_solaris.go b/collector/zfs_solaris.go index 4ff8ceb2..7229526c 100644 --- a/collector/zfs_solaris.go +++ b/collector/zfs_solaris.go @@ -61,10 +61,6 @@ const ( zfsCollectorSubsystem = "zfs" ) -func init() { - registerCollector("zfs", defaultEnabled, NewZfsCollector) -} - func NewZfsCollector(logger *slog.Logger) (Collector, error) { return &zfsCollector{ abdstatsLinearCount: prometheus.NewDesc(