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

Fix a bug with exposing prometheus client metrics in multiple components #53434

Conversation

crassirostris
Copy link

@crassirostris crassirostris commented Oct 4, 2017

I think this is a bug caused by splitting the repos: prometheus metrics are registered in a module that initialized metrics client-go never uses.

Fix a bug that prevents client-go metrics from being registered in prometheus in multiple components.

@crassirostris crassirostris added area/apiserver kind/bug Categorizes issue or PR as related to a bug. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. labels Oct 4, 2017
@crassirostris crassirostris added this to the v1.9 milestone Oct 4, 2017
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Oct 4, 2017
@caesarxuchao
Copy link
Member

/lgtm

It affects components other than the kube-apiserver. Could you check who else imports the prometheus initialization package?

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 4, 2017
@crassirostris
Copy link
Author

@caesarxuchao

$ grep -Ir 'k8s.io/kubernetes/pkg/client/metrics/prometheus'
federation/cmd/kubefed/app/kubefed.go:  _ "k8s.io/kubernetes/pkg/client/metrics/prometheus" // for client metric registration
cmd/cloud-controller-manager/controller-manager.go:     _ "k8s.io/kubernetes/pkg/client/metrics/prometheus" // for client metric registration
cmd/kubelet/kubelet.go: _ "k8s.io/kubernetes/pkg/client/metrics/prometheus" // for client metric registration
cmd/kube-controller-manager/controller-manager.go:      _ "k8s.io/kubernetes/pkg/client/metrics/prometheus" // for client metric registration
cmd/kube-apiserver/apiserver.go:        _ "k8s.io/kubernetes/pkg/client/metrics/prometheus" // for client metric registration
cmd/kube-proxy/proxy.go:        _ "k8s.io/kubernetes/pkg/client/metrics/prometheus" // for client metric registration
cmd/kubemark/hollow-node.go:    _ "k8s.io/kubernetes/pkg/client/metrics/prometheus" // for client metric registration
cmd/kubectl/app/kubectl.go:     _ "k8s.io/kubernetes/pkg/client/metrics/prometheus" // for client metric registration
cmd/hyperkube/main.go:  _ "k8s.io/kubernetes/pkg/client/metrics/prometheus" // for client metric registration

What to do next?

@caesarxuchao
Copy link
Member

I'm trying to say this is fixing a bug that affects all the components listed in the "grep" result. Could you update the release note to say something like "fix a bug that hides client-go metrics"?

@crassirostris
Copy link
Author

Could you update the release note

Oh, now I see what you mean! Got confused, sorry

@crassirostris crassirostris changed the title Enable prometheus client metrics in apiserver Fix a bug with exposing prometheus client metrics in multiple components Oct 5, 2017
@crassirostris
Copy link
Author

@caesarxuchao Done, thanks for noticing! PTAL

@caesarxuchao
Copy link
Member

Still lgtm. Thanks.

I'm surprised that we didn't have a bug report earlier.

@caesarxuchao
Copy link
Member

caesarxuchao commented Oct 5, 2017

/assign @thockin

for approval.

@thockin
Copy link
Member

thockin commented Oct 6, 2017

/approve no-issue

@k8s-github-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: caesarxuchao, crassirostris, thockin

Associated issue requirement bypassed by: thockin

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@k8s-github-robot k8s-github-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 6, 2017
@k8s-github-robot
Copy link

/test all [submit-queue is verifying that this PR is safe to merge]

@k8s-github-robot
Copy link

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions here.

@k8s-github-robot k8s-github-robot merged commit 9602878 into kubernetes:master Oct 6, 2017
@crassirostris crassirostris modified the milestones: v1.9, v1.8 Oct 13, 2017
k8s-github-robot pushed a commit that referenced this pull request Oct 21, 2017
…-#53434-upstream-release-1.8

Automatic merge from submit-queue.

Automated cherry pick of #53434

Cherry pick of #53434 on release-1.8.

#53434: Enable prometheus client metrics in apiserver

```releate-note
Fix a bug that prevents client-go metrics from being registered in prometheus in multiple components.
```
@k8s-cherrypick-bot
Copy link

Commit found in the "release-1.8" branch appears to be this PR. Removing the "cherrypick-candidate" label. If this is an error find help to get your PR picked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/apiserver cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants