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

zfs_freebsd: Was PR #2753 incomplete? #2896

Closed
phyber opened this issue Jan 8, 2024 · 2 comments
Closed

zfs_freebsd: Was PR #2753 incomplete? #2896

phyber opened this issue Jan 8, 2024 · 2 comments

Comments

@phyber
Copy link
Contributor

phyber commented Jan 8, 2024

Host operating system: output of uname -a

FreeBSD hostname.local 13.2-RELEASE-p8 FreeBSD 13.2-RELEASE-p8 GENERIC amd64

node_exporter version: output of node_exporter --version

Building from current master d8e2be1e88b3d663a5852f04efd695461e722be4

Are you running node_exporter in Docker?

No

What did you do that produced an error?

Attempt to compile it

What did you expect to see?

Output of a nice node_exporter binary

What did you see instead?

# github.com/prometheus/node_exporter/collector
collector/exec_bsd.go:65:4: undefined: labels
collector/exec_bsd.go:65:12: cannot use nil as bsdSysctl value in array or slice literal
collector/zfs_freebsd.go:337:6: undefined: strings
collector/zfs_freebsd.go:338:46: undefined: strings
collector/zfs_freebsd.go:342:28: undefined: zfsDatasetsNames
collector/zfs_freebsd.go:345:15: undefined: strings
collector/zfs_freebsd.go:349:22: undefined: fmt.SprintF
collector/zfs_freebsd.go:350:22: undefined: fmt.SprintF
collector/zfs_freebsd.go:351:60: undefined: poolObj

The labels issue was an easy fix, and I've submitted PR #2895 for that.

The zfs_freebsd.go stuff is more complicated. It looks like the author of #2753 may have submitted incomplete and untested/uncompiled code. For example:

  • The strings library wasn't imported
  • fmt.SprintF doesn't exist, it's fmt.Sprintf
  • zfsDatasetsNames doesn't exist, it's zfsDatasetNames
  • A poolObj variable appears from nowhere (isn't defined)

Most of these appear to be easily fixable, but I have no idea where poolObj should be coming from.

Resolving the easy issues from above results in further errors:

collector/zfs_freebsd.go:338:24: cannot use dataset (variable of type int) as string value in argument to strings.HasSuffix
collector/zfs_freebsd.go:339:65: cannot use dataset (variable of type int) as string value in argument to strings.SplitAfter
collector/zfs_freebsd.go:345:15: cannot use zpoolDataset (variable of type int) as string value in map literal
collector/zfs_freebsd.go:346:34: cannot use zpoolDataset (variable of type int) as string value in argument to strings.SplitAfter
collector/zfs_freebsd.go:352:60: undefined: poolObj

I don't know if the whole #2753 should be backed out or not. There's a lot of breakage here.

@dswarbrick
Copy link
Contributor

Relates-to: #2874

@phyber
Copy link
Contributor Author

phyber commented Feb 18, 2024

Closing since the broken feature seems to have been reverted out, thanks.

@phyber phyber closed this as completed Feb 18, 2024
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

2 participants