From 08010fb4a0225b15b7c382a4f6b16066998d2d18 Mon Sep 17 00:00:00 2001 From: Daniel Kimsey <90741+dekimsey@users.noreply.github.com> Date: Sat, 23 Mar 2024 13:57:56 -0500 Subject: [PATCH] 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> Signed-off-by: Vitaly Zhuravlev --- collector/zfs_freebsd.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/collector/zfs_freebsd.go b/collector/zfs_freebsd.go index bc4aa1c3f7..804d4f58a9 100644 --- a/collector/zfs_freebsd.go +++ b/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 }