-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Collection of custom metrics #802
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
Conversation
Can one of the admins verify this patch? |
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project, in which case you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
I signed it. |
Lets rebase this off of master since we merged the other PR |
c9372cc
to
49c96df
Compare
} | ||
} else { | ||
return nextCollectionTime, nil, errors.New("No match found for metric regexp: " + metricConfig.Regex) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be skipped if we want to continue collection of other valid metrics.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably keep a slice of errors that we then compile together. We try to get all the metrics we can and only return errors at the end. We can use:
https://github.com/GoogleCloudPlatform/kubernetes/blob/master/pkg/util/errors/errors.go#L31
95b4ccf
to
faa9f02
Compare
|
||
matchString := regex.FindStringSubmatch(string(pageContent)) | ||
if matchString != nil { | ||
if strings.Contains(matchString[1], ".") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we rely on the config to know if we are expecting floats or ints?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My concern was the way in which the metric would be expressed : int, integer, int32, number ...
But yes, I think this is a better approach. We can use enum for metric units if necessary
@anushree-n Can you rebase and squash? |
d7aac33
to
1197b7b
Compare
1197b7b
to
6cc9d44
Compare
Done, @rjnagal :) |
LGTM |
Based on #787
Adds Implementation of Collect() method of Collector interface