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 213 #369

Closed
wants to merge 28 commits into from

Conversation

cbstewart9393
Copy link
Contributor

This is a follow on to PR #213, it includes all commits from that PR submitted by plus additional commits addressing feedback from that PR. Is it necessary to bring the commit count down? If so, how many commits would it be appropriate to get down to?

problame and others added 26 commits November 28, 2016 08:38
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.
Use ConstMetric with UntypedValue.
Handle nozfs build flag.
Remove computed values.
collector now does not expose metrics if stats cannot be fetched.
Instantiate a zfsMetricProvider per Update() call.
Remove predefined list of metrics.
Remove C code for accessing sysctls on FreeBSD, use sysctl(8) instead.
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>
Signed-Off-By: Corey Stewart <stewa169@purdue.edu>
}

func (c *zfsCollector) Update(ch chan<- prometheus.Metric) (err error) {
err = c.zfsAvailable()
Copy link
Member

Choose a reason for hiding this comment

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

This causes the stats file to be opened twice. This can be skipped and just use the error returned by updateArcstats()

@joehandzik
Copy link
Contributor

@SuperQ Thanks for taking a look. @cbstewart9393's internship ended a few days ago, but I'll ping him and see if he can make the requested update and squash it with his fixup patch.

Do you have any thoughts on the other question he asked about the commit count? It's quite high, but the original commits aren't his. I'm not sure if he can squash down those commits and still maintain @problame's ownership of the work. If y'all don't care about the commit count, then we'll leave it as is. If you do, we need some feedback from @problame on how to proceed...or mess around with rebasing and see if we can maintain ownership appropriately.

@SuperQ
Copy link
Member

SuperQ commented Dec 21, 2016

At a minimum I would squash with fixup any commit that has the word "fix" in it. 😄

@discordianfish
Copy link
Member

Shouldn't be a problem to squash @problame's commits, as long as you don't squash them together with @cbstewart9393

@dominikh
Copy link
Contributor

592c716 removes FreeBSD support (which I would be willing to add back if/when the PR is merged), but leaves behind FreeBSD build tags and test files. The current version of the PR likely doesn't compile on FreeBSD at all.

@joehandzik
Copy link
Contributor

@discordianfish @dominikh @SuperQ Thanks for taking a look again, and sorry for the delay (winter holiday/vacation). To distill down into concrete steps:

  1. Fix the opening of the stats file twice issue pointed out by @SuperQ, and squash with fb0e85d

  2. Squash together as many of @problame's initial patches as possible. At minimum, anything dealing with a "fix" should be squashed together (or possibly just squash the fixes into the commit that they are intended to fix?).

Idea: Should we just squash ALL commits from @problame into a single commit and call it a day? I personally like commits that actually implement an entire feature, but we'll go with whatever strategy you all prefer.

  1. As noted by @dominikh, remove ALL FreeBSD files and squash with 592c716

Note on number 3: I took a look at the tags on @cbstewart9393's fork and didn't notice any tags that we had created...can you offer a pointer to what you want removed, @dominikh?

@dominikh
Copy link
Contributor

dominikh commented Jan 4, 2017

@discordianfish
Copy link
Member

(or possibly just squash the fixes into the commit that they are intended to fix?).

Yes, that would be best. The goal is simply to have a commit history where every commit is can be built and used without errors.

I personally like commits that actually implement an entire feature, but we'll go with whatever strategy you all prefer.

I think we all agree that this is the way to go: Every commit should implement something useful on it's own. No need to overthink this, just try to have the commit history make sense.

@joehandzik
Copy link
Contributor

@dominikh Ah, I didn't even know that was there. Thank you for catching that, and we'll remove it in the FreeBSD removal commit.

@discordianfish We'll squash away all fixes then and leave some smaller number of feature commits from @problame (4 or 5 I would guess, based on a quick look at the commit history). Thanks!

Remove FreeBSD support for zfs.

Signed-Off-By: Corey Stewart <stewa169@purdue.edu>

Remove FreeBSD files
@joehandzik
Copy link
Contributor

@SuperQ @discordianfish @dominikh @cbstewart9393 I am in favor of closing this PR and resuming any further discussions in PR #410.

@discordianfish
Copy link
Member

SGTM

@discordianfish discordianfish mentioned this pull request Sep 10, 2018
tamcore pushed a commit to gitgrave/node_exporter that referenced this pull request Oct 22, 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

Successfully merging this pull request may close these issues.

6 participants