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

updates for zfsonlinux 0.7.5 #779

Merged
merged 3 commits into from
Feb 16, 2018

Conversation

richardelling
Copy link
Contributor

Adds metrics available in zfsonlinux version 0.7.5.

Changes failure handling when zfs stats files do not exist to maintain backwards compatibility with older zfsonlinux releases.

Copy link
Member

@discordianfish discordianfish left a comment

Choose a reason for hiding this comment

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

Looking good in general. I assume this is backwards compatible?

return fmt.Errorf("could not parse expected integer value for %q", key)
// kstat data type (column 2) should be KSTAT_DATA_UINT64 (4), otherwise ignore
// TODO: when other KSTAT_DATA_* types arrive, much of this will need to be restructured
if parts[1] == "4" {
Copy link
Member

Choose a reason for hiding this comment

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

I think we should define const for this to make it a bit more readable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good idea! I'll include a comment for the cross-reference to zfsonlinux code, too.

@richardelling
Copy link
Contributor Author

Regarding backwards compatibility:

  • the previous behavior was to quit processing the list of files if any file was missing
  • new ZFS stats features are delivered as new files
  • this PR adds the files appropriate to ZFS v.0.7.5
  • to maintain backwards compatibility, if a stats file does not exist we log a message at debug level and continue processing the files list

Tested against ZFS v0.6.5.6 (as delivered in Ubuntu 16.04) and ZFS v0.7.5

Copy link
Member

@discordianfish discordianfish left a comment

Choose a reason for hiding this comment

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

Ok, have no zfs to test but I'll take your word on this :). LGTM

Copy link
Member

@SuperQ SuperQ left a comment

Choose a reason for hiding this comment

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

LGTM

@SuperQ SuperQ merged commit d7348a5 into prometheus:master Feb 16, 2018
oblitorum pushed a commit to shatteredsilicon/node_exporter that referenced this pull request Apr 9, 2024
* updates for zfsonlinux 0.7.5

* add constants for KSTAT_DATA_* types

* added e2e test for negative values represented by uint64 that can result from ZFS bugs
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

Successfully merging this pull request may close these issues.

3 participants