matusnovak / prometheus-zfs

Prometheus exporter for (some) ZFS statistics via zpool iostatus and zfs get space
The Unlicense
18 stars 4 forks source link

Feature request: Update to support vdev properties #3

Open debdrup opened 2 years ago

debdrup commented 2 years ago

OpenZFS 2.2 or 3.0 will add vdev properties, and it's be nice to have the information from it in prometheus-zfs, so I think it's okay to request this.

They add a bunch more properties that can be used for graphing information, and it would be very nice if they can be used in prometheus.

Here's an example of the output of zpool get all zroot all-vdevs:

NAME             PROPERTY           VALUE                SOURCE
nda0p3.eli       capacity           31%                  -
nda0p3.eli       state              ONLINE               -
nda0p3.eli       guid               9414597141481046164  -
nda0p3.eli       asize              222G                 -
nda0p3.eli       psize              222G                 -
nda0p3.eli       ashift             12                   -
nda0p3.eli       size               222G                 -
nda0p3.eli       free               152G                 -
nda0p3.eli       allocated          70.2G                -
nda0p3.eli       comment            -                    default
nda0p3.eli       expandsize         -                    -
nda0p3.eli       fragmentation      0%                   -
nda0p3.eli       bootsize           0                    default
nda0p3.eli       parity             0                    -
nda0p3.eli       path               /dev/nda0p3.eli      -
nda0p3.eli       devid              -                    default
nda0p3.eli       physpath           -                    default
nda0p3.eli       encpath            -                    default
nda0p3.eli       fru                -                    default
nda0p3.eli       parent             zroot                -
nda0p3.eli       children           -                    default
nda0p3.eli       numchildren        0                    -
nda0p3.eli       read_errors        0                    -
nda0p3.eli       write_errors       0                    -
nda0p3.eli       checksum_errors    0                    -
nda0p3.eli       initialize_errors  0                    -
nda0p3.eli       null_ops           0                    -
nda0p3.eli       read_ops           400K                 -
nda0p3.eli       write_ops          647K                 -
nda0p3.eli       free_ops           0                    -
nda0p3.eli       claim_ops          0                    -
nda0p3.eli       trim_ops           66.7K                -
nda0p3.eli       null_bytes         0                    -
nda0p3.eli       read_bytes         7.58G                -
nda0p3.eli       write_bytes        10.8G                -
nda0p3.eli       free_bytes         0                    -
nda0p3.eli       claim_bytes        0                    -
nda0p3.eli       trim_bytes         7.45G                -
nda0p3.eli       removing           off                  -
nda0p3.eli       allocating         on                   default

Most of them are self-explanatory, but physpath and encpath are the physical path (in FreeBSD this is exposed as part of GEOM), and encpath is the enclosure path from SES (which is part of SAS).

Allan Jude recently did a talk about it at BSDcan. If interested, I can update this issue with the video when it gets published.

matusnovak commented 1 year ago

Hi. I apologize for a late reply.

This is definitely useful and would make parsing the metrics easier. I did not have a lot of time to work on this project, and probably I won't have time in the near future. However, PRs are more than welcome!

If you still have the link, feel free to post it. I would be interested to see the talk.

debdrup commented 1 year ago

No worries, I understand that life can get in the way.

It's a good thing you asked about the video, since I'd utterly forgotten - it's available here. :)