-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
fix(inputs.zfs): Gathering poolMetrics failed on zfs 2.2.0 #14280
fix(inputs.zfs): Gathering poolMetrics failed on zfs 2.2.0 #14280
Conversation
Thanks so much for the pull request! |
!signed-cla |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much @delichik for your fix! Much appreciated. Two minor comments from my side... Can you please have a look!?
plugins/inputs/zfs/zfs_linux.go
Outdated
func gather(lines []string, fileLines int) ([]string, []string, error) { | ||
if len(lines) != fileLines { | ||
return nil, nil, errors.New("expected lines in kstat does not match") | ||
func gather(lines []string, minimalFileLines int) ([]string, []string, error) { | ||
if len(lines) < minimalFileLines { | ||
return nil, nil, errors.New("lines in kstat is not enough") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please minimize the changes here by keeping the parameter-name fileLines
instead of renaming it!?! The same holds true for the error message.
plugins/inputs/zfs/README.md
Outdated
For ZFS >= 2.2.x the format has changed significantly: | ||
|
||
- zfs_pool | ||
- writes (integer, count) | ||
- nwritten (integer, bytes) | ||
- reads (integer, count) | ||
- nread (integer, bytes) | ||
- nunlinks (integer, count) | ||
- nunlinked (integer, count) | ||
- zil_commit_count (integer, count) | ||
- zil_commit_writer_count (integer, count) | ||
- zil_itx_count (integer, count) | ||
- zil_itx_indirect_count (integer, count) | ||
- zil_itx_indirect_bytes (integer, bytes) | ||
- zil_itx_copied_count (integer, count) | ||
- zil_itx_copied_bytes (integer, bytes) | ||
- zil_itx_needcopy_count (integer, count) | ||
- zil_itx_needcopy_bytes (integer, bytes) | ||
- zil_itx_metaslab_normal_count (integer, count) | ||
- zil_itx_metaslab_normal_bytes (integer, bytes) | ||
- zil_itx_metaslab_normal_write (integer, bytes) | ||
- zil_itx_metaslab_normal_alloc (integer, bytes) | ||
- zil_itx_metaslab_slog_count (integer, count) | ||
- zil_itx_metaslab_slog_bytes (integer, bytes) | ||
- zil_itx_metaslab_slog_write (integer, bytes) | ||
- zil_itx_metaslab_slog_alloc (integer, bytes) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe
For ZFS >= 2.2.x the format has changed significantly: | |
- zfs_pool | |
- writes (integer, count) | |
- nwritten (integer, bytes) | |
- reads (integer, count) | |
- nread (integer, bytes) | |
- nunlinks (integer, count) | |
- nunlinked (integer, count) | |
- zil_commit_count (integer, count) | |
- zil_commit_writer_count (integer, count) | |
- zil_itx_count (integer, count) | |
- zil_itx_indirect_count (integer, count) | |
- zil_itx_indirect_bytes (integer, bytes) | |
- zil_itx_copied_count (integer, count) | |
- zil_itx_copied_bytes (integer, bytes) | |
- zil_itx_needcopy_count (integer, count) | |
- zil_itx_needcopy_bytes (integer, bytes) | |
- zil_itx_metaslab_normal_count (integer, count) | |
- zil_itx_metaslab_normal_bytes (integer, bytes) | |
- zil_itx_metaslab_normal_write (integer, bytes) | |
- zil_itx_metaslab_normal_alloc (integer, bytes) | |
- zil_itx_metaslab_slog_count (integer, count) | |
- zil_itx_metaslab_slog_bytes (integer, bytes) | |
- zil_itx_metaslab_slog_write (integer, bytes) | |
- zil_itx_metaslab_slog_alloc (integer, bytes) | |
For ZFS >= 2.2.x the following additional fields are available: | |
- additional fields for ZFS > 2.2.x | |
- zil_commit_count (integer, count) | |
- zil_commit_writer_count (integer, count) | |
- zil_itx_count (integer, count) | |
- zil_itx_indirect_count (integer, count) | |
- zil_itx_indirect_bytes (integer, bytes) | |
- zil_itx_copied_count (integer, count) | |
- zil_itx_copied_bytes (integer, bytes) | |
- zil_itx_needcopy_count (integer, count) | |
- zil_itx_needcopy_bytes (integer, bytes) | |
- zil_itx_metaslab_normal_count (integer, count) | |
- zil_itx_metaslab_normal_bytes (integer, bytes) | |
- zil_itx_metaslab_normal_write (integer, bytes) | |
- zil_itx_metaslab_normal_alloc (integer, bytes) | |
- zil_itx_metaslab_slog_count (integer, count) | |
- zil_itx_metaslab_slog_bytes (integer, bytes) | |
- zil_itx_metaslab_slog_write (integer, bytes) | |
- zil_itx_metaslab_slog_alloc (integer, bytes) | |
you are right. thanks a lot |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @delichik for the quick response!
Download PR build artifacts for linux_amd64.tar.gz, darwin_amd64.tar.gz, and windows_amd64.zip. 📦 Click here to get additional PR build artifactsArtifact URLs |
resolves #14279