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

fix(inputs.zfs): Gathering poolMetrics failed on zfs 2.2.0 #14280

Merged
merged 8 commits into from
Nov 13, 2023

Conversation

delichik
Copy link
Contributor

@delichik delichik commented Nov 13, 2023

resolves #14279

@telegraf-tiger
Copy link
Contributor

Thanks so much for the pull request!
🤝 ✒️ Just a reminder that the CLA has not yet been signed, and we'll need it before merging. Please sign the CLA when you get a chance, then post a comment here saying !signed-cla

@delichik delichik changed the title Fix inputs.zfs gather poolMetrics failed on zfs 2.2.0 fix(inputs.zfs): gather poolMetrics failed on zfs 2.2.0 Nov 13, 2023
@delichik delichik changed the title fix(inputs.zfs): gather poolMetrics failed on zfs 2.2.0 fix(inputs.zfs): Gathering poolMetrics failed on zfs 2.2.0 Nov 13, 2023
@delichik
Copy link
Contributor Author

!signed-cla

Copy link
Member

@srebhan srebhan left a 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!?

Comment on lines 86 to 88
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")
Copy link
Member

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.

Comment on lines 226 to 252
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)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe

Suggested change
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)

@srebhan srebhan self-assigned this Nov 13, 2023
@srebhan srebhan added area/agent plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins fix pr to fix corresponding bug and removed area/agent labels Nov 13, 2023
@delichik
Copy link
Contributor Author

Thank you very much @delichik for your fix! Much appreciated. Two minor comments from my side... Can you please have a look!?

you are right. thanks a lot

Copy link
Member

@srebhan srebhan left a 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!

@srebhan srebhan added the ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. label Nov 13, 2023
@srebhan srebhan assigned powersj and unassigned srebhan Nov 13, 2023
@powersj powersj merged commit b7e7756 into influxdata:master Nov 13, 2023
4 checks passed
@github-actions github-actions bot added this to the v1.28.4 milestone Nov 13, 2023
@telegraf-tiger
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix pr to fix corresponding bug plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[inputs.zfs] no zfs_pool on linux with poolMetrics=true and zfs=2.2.0
3 participants