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

Add ZFS collector + review feedback from PRs 213 and 369 #410

Merged
merged 6 commits into from
Jan 9, 2017
Merged

Add ZFS collector + review feedback from PRs 213 and 369 #410

merged 6 commits into from
Jan 9, 2017

Conversation

joehandzik
Copy link
Contributor

Apologies for creating another PR, my intern is no longer available to complete the work. This is the last time this would need to happen (I'll get this over the finish line). Here is what changes have been factored in based on the feedback from PR 369:

  1. Fixed opening stats file twice caught by @SuperQ.
  2. Squashed @problame's commits heavily, down into two commits (one for README updates and enabling the ZFS plugin by default, another for the final ZFS collector after all feedback had been incorporated).
  3. Removed the FreeBSD tag caught by @dominikh, and removed all FreeBSD files (one fixture file and all zpool data, because it only had FreeBSD support. zpool data could be added via a new PR).

I think this took all feedback into account, but please let me know if there's more needed. Thanks!

@joehandzik
Copy link
Contributor Author

Note: Looks like CI is failing on the darwin build. Would an acceptable workaround for now be to prevent the ZFS component from being enabled by default, at least until FreeBSD compatibility is added? I'm open to alternatives, but am not sure what they would be with the way the code is written at the moment.

@discordianfish
Copy link
Member

@joehandzik Yes, zfs doesn't need to get built at all on darwin. But it looks like the build tag for that is already there.. Confused why it's trying to build that.

@joehandzik
Copy link
Contributor Author

@discordianfish I had the same thought, but I am pretty new to both Go and circleci so I am willing to assume that I'm doing something wrong. I'll poke around and see if I can fix it, but I don't really have any bright ideas at the moment.

@joehandzik
Copy link
Contributor Author

@discordianfish I fixed it. The build tags for collector/zfs.go were below the 'package collector' line, which means that they get ignored (I guess?).

zfsArcstatsProcpath = "spl/kstat/zfs/arcstats"
)

func (c *zfsCollector) zfsAvailable() (err error) {
Copy link
Member

Choose a reason for hiding this comment

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

It looks like this function is obsolete and can be removed.

@joehandzik
Copy link
Contributor Author

@SuperQ Removed it just now. Thanks!

@SuperQ
Copy link
Member

SuperQ commented Jan 8, 2017

Looking good, please add zfs to the collectors list in end-to-end-test.sh. This will enable the fixture test and update e2e-output.txt. Then I think we're good to go.

problame and others added 6 commits January 8, 2017 10:23
It is tested on FreeBSD 10.2-RELEASE and Linux (ZFS on Linux 0.6.5.4).

On FreeBSD, Solaris, etc. ZFS metrics are exposed through sysctls.
ZFS on Linux exposes the same metrics through procfs `/proc/spl/...`.

In addition to sysctl metrics, 'computed metrics' are exposed by
the collector, which are based on several sysctl values.
There is some conditional logic involved in computing these metrics
which cannot be easily mapped to PromQL.

Not all 92 ARC sysctls are exposed right now but this can be changed
with one additional LOC each.
This patch makes stylistic changes to error strings, unexports method names by lower casing them, removes unused dataSetMetric, and adds copyright/licence information.

Signed-Off-By: Corey Stewart <stewa169@purdue.edu>
This also involves removing zfs_zpool code for now.

Signed-Off-By: Corey Stewart <stewa169@purdue.edu>
Signed-Off-By: Joe Handzik <joseph.t.handzik@hpe.com>
Enables fixture test and updates e2e-output.txt.

Signed-Off-By: Joe Handzik <joseph.t.handzik@hpe.com>
Signed-Off-By: Joe Handzik <joseph.t.handzik@hpe.com>
@SuperQ
Copy link
Member

SuperQ commented Jan 8, 2017

Cool, just need to ad the e2e fixture changes and it should pass tests again.

@joehandzik
Copy link
Contributor Author

@SuperQ Ok, added a commit to enable the zfs plugin in the e2e tests...but now the travis-ci build fails. circleci still passes. I can't figure out what failed in the travis build, but it failed even after rebasing in everything from master. The only thing that looks remotely like a failure (to me) in the logs is the warning about megacli being deprecated. Any ideas?

@joehandzik
Copy link
Contributor Author

@SuperQ Ok, finally figured it out and did what you said, looks like everything works again. Thanks for the help!

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

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.

LGTM!

@discordianfish
Copy link
Member

Great, thanks a lot for the contribution!

@discordianfish discordianfish merged commit e9cea11 into prometheus:master Jan 9, 2017
@joehandzik
Copy link
Contributor Author

@discordianfish And thanks to you for dealing with all the thrashing on this contribution. Future contributions won't require three different PRs, I promise!

@SuperQ SuperQ mentioned this pull request Jan 15, 2017
@grobie grobie mentioned this pull request Feb 1, 2017
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.

5 participants