prometheus / prometheus/node_exporter
ZFS collector uses different names for the same metric on FreeBSD vs Linux
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 13.8k
- Forks
- 2.7k
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 8
Description
Host operating system: output of uname -a
FreeBSD shoebox 12.2-RELEASE-p2 FreeBSD 12.2-RELEASE-p2 663e6b09467(HEAD) TRUENAS amd64Linux ishtar 5.8.0-40-generic #45-Ubuntu SMP Fri Jan 15 11:05:36 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
node_exporter version: output of node_exporter --version
I'm using the packaged versions for FreeBSD 12 (latest) and Ubuntu 20.10
node_exporter, version 1.0.1 (branch: release-1.0, revision: 0)
build user: root
build date:
go version: go1.15.6
node_exporter, version 1.0.1+ds (branch: debian/sid, revision: 1.0.1+ds-1)
build user: pkg-go-maintainers@lists.alioth.debian.org
build date: 20200618-22:00:01
go version: go1.14.4
node_exporter command line flags
FreeBSD: --web.listen-address=172.17.3.5:9100 --collector.textfile.directory=/var/tmp/node_exporter --collector.zfs
Linux: (none, using defaults)
Are you running node_exporter in Docker?
No
What did you do that produced an error?
Ran node_exporter, collecting ZFS metrics on both Linux and FreeBSD
What did you expect to see?
Metrics would have the same name (I think that's the right term?) from both nodes.
What did you see instead?
The names of metrics exported from FreeBSD are different from the ones from Linux.
Extra Comments
The FreeBSD system is more precisely running TrueNAS, but it's close enough to FreeBSD that it doesn't make a big difference. The FreeBSD system is using OpenZFS 2.0, while the Linux system is using ZFSonLinux 0.8.4 (same project, they're skipping 1.0 while unifying the different OSs to a single codebase), so they're close enough that it shouldn't make a difference.
The FreeBSD ZFS collector is modifying the names that it's reading from sysctl, while the Linux ZFS collector seems to be basically dumping the contents of /proc/spl/kstat/zfs/*, munging the names so that they fit the proper naming scheme.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with collector/zfs_freebsd.go, especially the metric-name handling linked in the issue, and compare it with the Linux collector's reading of /proc/spl/kstat/zfs/*. Run node_exporter with the ZFS collector on both FreeBSD and Linux, then verify that equivalent ZFS metrics are exported under the same names.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- observability-sre
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100