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>
This commit is contained in:
Daniel Kimsey 2024-03-23 13:57:56 -05:00 committed by Johannes 'fish' Ziemke
parent b6227af54b
commit 29cdbd63fe

View File

@ -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
}