Skip to content

Commit

Permalink
zfs: Log mib when sysctl read fails on FreeBSD
Browse files Browse the repository at this point in the history
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 prometheus#2847

Signed-off-by: Daniel Kimsey <[email protected]>
Signed-off-by: Vitaly Zhuravlev <[email protected]>
  • Loading branch information
dekimsey authored and v-zhuravlev committed Nov 1, 2024
1 parent 1160e0f commit 08010fb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion collector/zfs_freebsd.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 08010fb

Please sign in to comment.