diff --git a/collector/zfs_freebsd.go b/collector/zfs_freebsd.go index 2b3948a50a..38379039d6 100644 --- a/collector/zfs_freebsd.go +++ b/collector/zfs_freebsd.go @@ -20,6 +20,7 @@ import ( "fmt" "github.com/go-kit/log" + "github.com/go-kit/log/level" "github.com/prometheus/client_golang/prometheus" "golang.org/x/sys/unix" @@ -241,6 +242,7 @@ func NewZfsCollector(logger log.Logger) (Collector, error) { valueType: prometheus.GaugeValue, labels: nil, }, + // when FreeBSD 14.0+, `meta/pm/pd` install of `p`. { name: "arcstats_p_bytes", description: "ZFS ARC MRU target size", @@ -249,6 +251,27 @@ func NewZfsCollector(logger log.Logger) (Collector, error) { valueType: prometheus.GaugeValue, labels: nil, }, + { + name: "arcstats_meta_bytes", + description: "ZFS ARC metadata target frac ", + mib: "kstat.zfs.misc.arcstats.meta", + dataType: bsdSysctlTypeUint64, + valueType: prometheus.GaugeValue, + }, + { + name: "arcstats_pd_bytes", + description: "ZFS ARC data MRU target frac", + mib: "kstat.zfs.misc.arcstats.pd", + dataType: bsdSysctlTypeUint64, + valueType: prometheus.GaugeValue, + }, + { + name: "arcstats_pm_bytes", + description: "ZFS ARC meta MRU target frac", + mib: "kstat.zfs.misc.arcstats.pm", + dataType: bsdSysctlTypeUint64, + valueType: prometheus.GaugeValue, + }, { name: "arcstats_size_bytes", description: "ZFS ARC size", @@ -282,7 +305,9 @@ func (c *zfsCollector) Update(ch chan<- prometheus.Metric) error { for _, m := range c.sysctls { v, err := m.Value() if err != nil { - return fmt.Errorf("couldn't get sysctl: %w", err) + // debug logging + level.Debug(c.logger).Log("name", m.name, "couldn't get sysctl:", err) + continue } ch <- prometheus.MustNewConstMetric(