-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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: expose per-dataset metrics in the ZFS collector on FreeBSD #2693
Comments
Exploring the sysctl metrics of my FreeBSD system with ZFS, I see:
I'm happy to iterate across such entries and plumb them into collector/zfs_freebsd.go |
Posting an update here for anyone looking for the feature in the future: The original implementation in #2753 calls I don't know how to do this. OP's example (https://github.com/asomers/ztop/blob/master/src/app.rs) seems to be a CLI that requires the user to specify pool names a priori, so it's not exactly useful in that regard (someone can check me on this, I may have missed something). I would try taking inspiration for how Which appears to be (somehow?) recursively searching the MIB tree for leaf-nodes. I am looking into this - as well as any other Go zfs libs that might make this easier - but wanted to leave all of this info here for others to pick up or help if possible. |
Actually, ztop does not require the user to specify a pool name; that's optional. What it does is it walks the whole tree of kstat.zfs and looks for any mibs ending in |
Also, because I lack the Go skills necessary to complete this task, I wrote a separate Prometheus exporter in Rust (based on the ztop code) to export this data. It's closed-source for now, but if there's community interest we would release it. |
Interesting. I'll have to read more into
I think this is similar to what
I can't speak for the community, but I would certainly take any help I can get in figuring this out. I have only been tinkering with Go/FreeBSD for the last week or so all help is good help. Let me know if you'd rather share the code in a private channel like IRC/Matrix/Discord/Email. |
As far as the sysctl-parsing part goes, the code is the same in the open source ztop as in the closed source ztop-exporter. |
I suspect that the kstat interface is fine if you already know what objset ID you are looking for, but for enumerating these in the first place, a journey into the world of ioctl is probably necessary. A
hex(75) = 0x4b ...
Something like |
Host operating system: output of
uname -a
FreeBSD, all versions
node_exporter version: output of
node_exporter --version
1.5.0
Feature
PR #1632 exposed ZFS's per-dataset performance metrics, but only on Linux. The same metrics are available on FreeBSD. However, whereas on Linux they are presented as files in /proc , on FreeBSD they are presented as sysctls. The ZFS collector already publishes non-dataset-specific metrics on FreeBSD, so I would think that it shouldn't be too hard to add the dataset-specific ones too. See https://github.com/asomers/ztop/blob/master/src/app.rs for an example (in Rust) of a project that parses both Linux's and FreeBSD's ZFS per-dataset metrics.
The text was updated successfully, but these errors were encountered: