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 target and current cpu utilization in hpa metrics #768

Closed
mohit-gupta opened this issue May 24, 2019 · 9 comments · Fixed by #966
Closed

Add target and current cpu utilization in hpa metrics #768

mohit-gupta opened this issue May 24, 2019 · 9 comments · Fixed by #966

Comments

@mohit-gupta
Copy link

Want to monitor the current and target CPU utilization for deployments via Prometheus. However, it does not seem to available in the current list of HPA metrics (https://github.com/kubernetes/kube-state-metrics/blob/1dfe6681e9/docs/horizontalpodautoscaler-metrics.md).

Is there any other way to get these values in Prometheus? If not, can they be added to the HPA metrics?

@brancz
Copy link
Member

brancz commented May 28, 2019

Utilization metrics should be scraped from cAdvisor, which is built into the kubernetes kubelet. kube-state-metrics is just about converting API objects to Prometheus metrics.

@brancz brancz closed this as completed May 28, 2019
@janzantinge
Copy link
Contributor

janzantinge commented Oct 25, 2019

@brancz The HPA target CPU utilization isn't published by cAdvisor is it? It seems like there should be another HPA metric like kube_hpa_spec_target{metric="cpu"...} or something along those lines that can publish the resource target part of the HPA spec. I may be missing something as I'm still pretty new to k8s.

@brancz
Copy link
Member

brancz commented Oct 28, 2019

Sorry I think I misunderstood last time, as this is more or less a static value on the HPA object, this should indeed come from kube-state-metrics.

/reopen

@k8s-ci-robot
Copy link
Contributor

@brancz: Reopened this issue.

In response to this:

Sorry I think I misunderstood last time, as this is more or less a static value on the HPA object, this should indeed come from kube-state-metrics.

/reopen

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot reopened this Oct 28, 2019
@janzantinge
Copy link
Contributor

@brancz Is this something I can contribute?

@brancz
Copy link
Member

brancz commented Oct 31, 2019

I believe it’s already in progress #961

@janzantinge
Copy link
Contributor

IIUC that PR doesn't include the target utilization values specified in the Spec, only the current utilization values in the Status.

@brancz
Copy link
Member

brancz commented Oct 31, 2019

You're right. Feel free to open another PR in that case :)

@janzantinge
Copy link
Contributor

Here goes nothing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants