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

Labeling overhaul #118

Merged
merged 1 commit into from
Aug 14, 2017
Merged

Labeling overhaul #118

merged 1 commit into from
Aug 14, 2017

Conversation

joehandzik
Copy link
Contributor

Convert Generic to generic for generic metric labels.
Realign labeling to share common label names across the board. Instead of MDS, MGS, OST, etc having different labels, they all have "component" and "host" labels now.

Signed-Off-By: Joe Handzik joseph.t.handzik@hpe.com

Fixes #100

@joehandzik joehandzik requested a review from roclark August 10, 2017 21:05
Copy link
Contributor

@roclark roclark left a comment

Choose a reason for hiding this comment

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

I'm good with this, just some comments and questions, but I don't see anything we need to change. Great work by the way! I know the sorting of labels was a pain, but glad it worked out.

@@ -16,7 +16,7 @@ GOPATH := $(firstword $(subst :, ,$(shell $(GO) env GOPATH)))
PROMU ?= $(GOPATH)/bin/promu
GOLINTER ?= $(GOPATH)/bin/gometalinter
#aligncheck and gosimple took unfortunately too long at travisCI
GOLINTER_OPT ?= --vendor --deadline 6m --cyclo-over=19 --disable=aligncheck --disable=gosimple
Copy link
Contributor

Choose a reason for hiding this comment

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

I still think it would be great if we could disable the cyclo-check for the *test.go files, but I'm not sure that's possible... C'est la vie.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Perhaps a separate contribution to the metalinter project? :P

}
}

return 0, errors.New("Strings are too similar")
Copy link
Contributor

Choose a reason for hiding this comment

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

Just curious, if you have two identical strings/labels, does the test break? ie. Say you have a [bad] metric of metric{"name": "metric", "name": "metric"}, does it fail in this scenario? I think I'm a little confused as to this line... I believe you that it would be necessary, I'm just struggling to think of a scenario, so I want to learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Regardless of if I could write the code to make it pass, we're in a bad situation if we have duplicate labels...so I just decided to return an error. It should fail, yes. Perhaps I should write unit tests...for unit tests... >_>

@@ -137,1159 +186,1167 @@ func blacklisted(blacklist []string, metricName string) bool {
}

func TestCollector(t *testing.T) {
targets := []string{"OST", "MDT", "MGS", "MDS", "Client", "Generic", "LNET"}
targets := []string{"MGS", "OST", "MDT", "MDS", "Client", "Generic", "LNET"}
Copy link
Contributor

Choose a reason for hiding this comment

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

Again, just curious, is there a reason that the order was changed? I don't have a problem with it but would like to know if it changes the functionality in any way. I'm assuming you switched the order here to test on a smaller sample size, yes? I think I recall you saying that...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I switched them for testing purposes (was impossible to figure out what I was doing wrong when testing against the OST data first). I can switch it back.

{"lustre_exports_pending_total", "Total number of exports that have been marked pending", counter, []labelPair{{"ost", "lustrefs-OST0001"}}, 2.513043456e+10, false},
{"lustre_recalc_freed_total", "Number of locks that have been freed", counter, []labelPair{{"ost", "lustrefs-OST0001"}}, 0, false},
{"lustre_lock_contended_total", "Number of contended locks", counter, []labelPair{{"ost", "lustrefs-OST0001"}}, 32, false},
{"lustre_recovery_time_hard_seconds", "Maximum timeout 'recover_time_soft' can increment to for a single server", gauge, []labelPair{{
Copy link
Contributor

Choose a reason for hiding this comment

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

I know you were thinking of this already, but "host" might not be the best descriptor here since "lustrefs-OST0000" is the filesystem and target names. Maybe "target" is better, but that might not be perfect when values of "osd" come in to play... I'm not sure what the best answer is here...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No rush to merge this PR, so we'll take some time to figure out the right answer here.

@joehandzik joehandzik force-pushed the wip-normalize-labels branch 2 times, most recently from 7b7eab0 to 0d02c61 Compare August 14, 2017 15:02
Convert Generic to generic for generic metric labels.
Realign labeling to share common label names across the board. Instead of MDS, MGS, OST, etc having different labels, they all have "component" and "host" labels now.

Signed-Off-By: Joe Handzik <joseph.t.handzik@hpe.com>
@joehandzik joehandzik force-pushed the wip-normalize-labels branch from 0d02c61 to 90980c3 Compare August 14, 2017 15:07
Copy link
Contributor

@roclark roclark left a comment

Choose a reason for hiding this comment

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

LGTM! You ready to merge?

@joehandzik
Copy link
Contributor Author

@roclark Sure, may as well. We're still below 1.0, so we can change the "target" name later if someone hates it.

@roclark
Copy link
Contributor

roclark commented Aug 14, 2017

Works for me!

@roclark roclark merged commit 4369692 into master Aug 14, 2017
@joehandzik joehandzik deleted the wip-normalize-labels branch August 15, 2017 15:25
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.

2 participants