Skip to content

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

Merged
merged 1 commit into from
Jul 14, 2015
Merged

Conversation

anushree-n
Copy link
Contributor

Based on #787
Adds Implementation of Collect() method of Collector interface

@cadvisorJenkinsBot
Copy link
Collaborator

Can one of the admins verify this patch?

@googlebot
Copy link
Collaborator

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!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please let us know the company's name.

@anushree-n
Copy link
Contributor Author

I signed it.

@vmarmol
Copy link
Contributor

vmarmol commented Jul 7, 2015

Lets rebase this off of master since we merged the other PR

}
} else {
return nextCollectionTime, nil, errors.New("No match found for metric regexp: " + metricConfig.Regex)
}
Copy link
Contributor Author

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.

Copy link
Contributor

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


matchString := regex.FindStringSubmatch(string(pageContent))
if matchString != nil {
if strings.Contains(matchString[1], ".") {
Copy link
Contributor

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?

Copy link
Contributor

Choose a reason for hiding this comment

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

+1

Copy link
Contributor Author

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

@rjnagal
Copy link
Contributor

rjnagal commented Jul 14, 2015

@anushree-n Can you rebase and squash?

@anushree-n
Copy link
Contributor Author

Done, @rjnagal :)

@rjnagal
Copy link
Contributor

rjnagal commented Jul 14, 2015

LGTM

rjnagal added a commit that referenced this pull request Jul 14, 2015
@rjnagal rjnagal merged commit d580ecf into google:master Jul 14, 2015
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