{"record":{"id":"c21b9809398d3a18","repo":"prometheus/node_exporter","slug":"zfs-zfs-statistics-are-not-available","errorCode":null,"errorMessage":"ZFS / ZFS statistics are not available","messagePattern":"ZFS / ZFS statistics are not available","errorType":"exception","errorClass":"errZFSNotAvailable","httpStatus":null,"severity":"info","filePath":"collector/zfs_linux.go","lineNumber":46,"sourceCode":"\n\t\"github.com/prometheus/client_golang/prometheus\"\n)\n\n// constants from https://github.com/zfsonlinux/zfs/blob/master/lib/libspl/include/sys/kstat.h\n// kept as strings for comparison thus avoiding conversion to int\nconst (\n\t// kstatDataChar   = \"0\"\n\t// kstatDataInt32  = \"1\"\n\t// kstatDataUint32 = \"2\"\n\tkstatDataInt64  = \"3\"\n\tkstatDataUint64 = \"4\"\n\t// kstatDataLong   = \"5\"\n\t// kstatDataUlong  = \"6\"\n\t// kstatDataString = \"7\"\n)\n\nvar (\n\terrZFSNotAvailable = errors.New(\"ZFS / ZFS statistics are not available\")\n\n\tzfsPoolStatesName = [...]string{\"online\", \"degraded\", \"faulted\", \"offline\", \"removed\", \"unavail\", \"suspended\"}\n)\n\ntype zfsCollector struct {\n\tlinuxProcpathBase    string\n\tlinuxZpoolIoPath     string\n\tlinuxZpoolObjsetPath string\n\tlinuxZpoolStatePath  string\n\tlinuxPathMap         map[string]string\n\tlogger               *slog.Logger\n}\n\n// NewZFSCollector returns a new Collector exposing ZFS statistics.\nfunc NewZFSCollector(logger *slog.Logger) (Collector, error) {\n\treturn &zfsCollector{\n\t\tlinuxProcpathBase:    \"spl/kstat/zfs\",\n\t\tlinuxZpoolIoPath:     \"/*/io\",","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/prometheus/node_exporter/blob/17ddd77c59ba27e1508e9f7894b1e55b44d6aed3/collector/zfs_linux.go#L28-L64","documentation":"errZFSNotAvailable signals that the ZFS /proc stat files (e.g., /proc/spl/kstat/zfs) do not exist, so ZFS statistics cannot be collected. Update translates it into ErrNoData so exporters report no data rather than failing collection — ZFS proc files appear as new ZFS features land.","triggerScenarios":"zfsCollector.Update or openProcFile fails to open the ZFS proc path, or updatePoolStats finds a subsystem proc file missing — typically when ZFS is not installed/loaded on Linux.","commonSituations":"node_exporter running on Linux hosts without ZFS modules loaded; containers without /proc/spl/kstat/zfs mounted; kernels with ZFS built without the kstat proc entries.","solutions":["Nothing to fix if ZFS is intentionally absent — the collector logs a debug message and skips; no error is surfaced.","If ZFS is expected, verify /proc/spl/kstat/zfs exists and the zfs kernel module is loaded (modprobe zfs).","In containers, mount /proc/spl/kstat/zfs into the container for the exporter.","Upgrade ZFS on Linux if specific subsystem proc files are missing."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"if _, err := os.Stat(\"/proc/spl/kstat/zfs\"); os.IsNotExist(err) {\n    logger.Info(\"ZFS not present; disable --collector.zfs\")\n}","typeGuard":null,"tryCatchPattern":"err := collector.Update(ch)\nif errors.Is(err, ErrNoData) {\n    logger.Debug(\"no data for zfs collector\")\n    return // not fatal\n}","preventionTips":["Disable --collector.zfs on hosts without ZFS.","Mount /proc/spl/kstat/zfs when running in containers.","Check module load (lsmod | grep zfs) when metrics are expected."],"tags":["go","linux","zfs","procfs"],"backgroundTag":"resource-not-found","analyzedSha":"17ddd77c59ba27e1508e9f7894b1e55b44d6aed3","analyzedAt":"2026-09-07T17:54:06.211Z","contentChangedAt":"2026-09-07T17:54:06.211Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}