From bc2b7b4dc038b81d150155110e7cefc0dd44ffc2 Mon Sep 17 00:00:00 2001 From: matt durham Date: Thu, 28 Sep 2023 09:56:24 -0400 Subject: [PATCH] fix filesystem on other archs --- collector/filesystem_common.go | 2 +- collector/filesystem_freebsd.go | 2 +- collector/filesystem_linux.go | 2 +- collector/filesystem_openbsd.go | 2 +- collector/loadavg_bsd.go | 2 +- collector/loadavg_solaris.go | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/collector/filesystem_common.go b/collector/filesystem_common.go index 824cf2c851..7723b727f4 100644 --- a/collector/filesystem_common.go +++ b/collector/filesystem_common.go @@ -160,7 +160,7 @@ func NewFilesystemCollector(config *NodeCollectorConfig, logger log.Logger) (Col } func (c *filesystemCollector) Update(ch chan<- prometheus.Metric) error { - stats, err := c.GetStats() + stats, err := c.GetStats(c.config.Path) if err != nil { return err } diff --git a/collector/filesystem_freebsd.go b/collector/filesystem_freebsd.go index f05702d14f..327916a59d 100644 --- a/collector/filesystem_freebsd.go +++ b/collector/filesystem_freebsd.go @@ -27,7 +27,7 @@ const ( ) // Expose filesystem fullness. -func (c *filesystemCollector) GetStats() ([]filesystemStats, error) { +func (c *filesystemCollector) GetStats(_ PathConfig) ([]filesystemStats, error) { n, err := unix.Getfsstat(nil, unix.MNT_NOWAIT) if err != nil { return nil, err diff --git a/collector/filesystem_linux.go b/collector/filesystem_linux.go index 963ab561b9..f403d953bc 100644 --- a/collector/filesystem_linux.go +++ b/collector/filesystem_linux.go @@ -40,7 +40,7 @@ var stuckMounts = make(map[string]struct{}) var stuckMountsMtx = &sync.Mutex{} // GetStats returns filesystem stats. -func (c *filesystemCollector) GetStats() ([]filesystemStats, error) { +func (c *filesystemCollector) GetStats(_ PathConfig) ([]filesystemStats, error) { mps, err := mountPointDetails(c.config, c.logger) if err != nil { return nil, err diff --git a/collector/filesystem_openbsd.go b/collector/filesystem_openbsd.go index 1c1e479e1f..eebb33290c 100644 --- a/collector/filesystem_openbsd.go +++ b/collector/filesystem_openbsd.go @@ -27,7 +27,7 @@ const ( ) // Expose filesystem fullness. -func (c *filesystemCollector) GetStats() (stats []filesystemStats, err error) { +func (c *filesystemCollector) GetStats(_ PathConfig) (stats []filesystemStats, err error) { var mnt []unix.Statfs_t size, err := unix.Getfsstat(mnt, unix.MNT_NOWAIT) if err != nil { diff --git a/collector/loadavg_bsd.go b/collector/loadavg_bsd.go index a1f5ae6643..1d591b8fbb 100644 --- a/collector/loadavg_bsd.go +++ b/collector/loadavg_bsd.go @@ -23,7 +23,7 @@ import ( "golang.org/x/sys/unix" ) -func getLoad() ([]float64, error) { +func getLoad(_ *NodeCollectorConfig) ([]float64, error) { type loadavg struct { load [3]uint32 scale int diff --git a/collector/loadavg_solaris.go b/collector/loadavg_solaris.go index 316233fa98..4d4c8e0978 100644 --- a/collector/loadavg_solaris.go +++ b/collector/loadavg_solaris.go @@ -43,7 +43,7 @@ func kstatToFloat(ks *kstat.KStat, kstatKey string) float64 { return kstatLoadavg } -func getLoad() ([]float64, error) { +func getLoad(_ *NodeCollectorConfig) ([]float64, error) { tok, err := kstat.Open() if err != nil { panic(err)