Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Report ZFS pool and volume size/alloc/free #3232

Open
philpem opened this issue Jan 30, 2025 · 0 comments
Open

Feat: Report ZFS pool and volume size/alloc/free #3232

philpem opened this issue Jan 30, 2025 · 0 comments

Comments

@philpem
Copy link

philpem commented Jan 30, 2025

I'm trying to add ZFS pool usage and free space to a Grafana dashboard, but it doesn't appear that node_exporter captures this data.

For clarification, I'd like the per-pool statistics as output by zpool list:

NAME    SIZE  ALLOC   FREE  CKPOINT  EXPANDSZ   FRAG    CAP  DEDUP    HEALTH  ALTROOT
zpool  21.8T  20.9T   917G        -         -    31%    95%  1.00x    ONLINE  -

And the volume statistics as shown by zfs list:

NAME                 USED  AVAIL     REFER  MOUNTPOINT
zpool               13.9T   483G      272K  /mnt/zfs
zpool/archive        601G   483G      601G  /mnt/zfs/archive
zpool/backups       3.20M   483G     2.97M  /mnt/zfs/backups
zpool/docker        3.12G   483G     3.12G  /mnt/zfs/docker

I tried to work around this by using the filesystem data, but this is misreported by the system itself:

$ df -h
Filesystem          Size  Used Avail Use% Mounted on
zpool               483G  384K  483G   1% /mnt/zfs
zpool/archive       1.1T  602G  483G  56% /mnt/zfs/archive
zpool/backups       483G  3.0M  483G   1% /mnt/zfs/backups
zpool/docker        486G  3.2G  483G   1% /mnt/zfs/docker

Notice how the "size" value is essentially arbitrary. This seems to be a ZFS-on-Linux quirk and makes it impossible (at least by any means I've tried) to use the filesystem stats to display the ZFS free space.

Notably the filesystem data grabber doesn't record the "used" space, only "avail" (or "free" which seems to be the same) and "size". Because the "size" is incorrect on ZFS filesystems, the usual method of dividing or subtracting doesn't work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant