Browse Source

zfs: Log mib when sysctl read fails on FreeBSD

When the zfs collector fails on FreeBSD it doesn't log which `mib` triggered the issue. This makes diagnostics hard.

Incompatibilities in the list of supported mibs is not uncommon with major os updates. By adding this change, it'll be easier for users to report the specific mib that is triggering the failure.

Related to #2847

Signed-off-by: Daniel Kimsey <90741+dekimsey@users.noreply.github.com>
pull/2950/merge
Daniel Kimsey 8 months ago committed by Johannes 'fish' Ziemke
parent
commit
29cdbd63fe
  1. 2
      collector/zfs_freebsd.go

2
collector/zfs_freebsd.go

@ -273,7 +273,7 @@ func (c *zfsCollector) Update(ch chan<- prometheus.Metric) error {
v, err := m.Value()
if err != nil {
// debug logging
level.Debug(c.logger).Log("name", m.name, "couldn't get sysctl:", err)
level.Debug(c.logger).Log("name", m.name, "mib", m.mib, "couldn't get sysctl:", err)
continue
}

Loading…
Cancel
Save