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

cant't scrape container metircs on kubernetes 1.10 #4434

Closed
Toper2035 opened this Issue Jul 30, 2018 · 3 comments

Comments

Projects
None yet
3 participants
@Toper2035
Copy link

Toper2035 commented Jul 30, 2018

I deployment prometheus and grafana for monitor on kubernetes 1.10, but prometheus can't scrape metrics about container, such as container_cpu_usage_seconds_total and so on.
the same prometheus configuration works well on kubernetes 1.16, I fond container metrics scraped from cadvisor port 10255 on k8s 1.6. The follow log show on k8s 1.6.
root@node1:~# curl 172.16.20.11:10255/metrics | grep container
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 1939k 0 3974 0 0 8764 0 0:03:46 --:--:-- 0:03:46 8753# HELP container_cpu_cfs_periods_total Number of elapsed enforcement period intervals.

TYPE container_cpu_cfs_periods_total counter

container_cpu_cfs_periods_total{container_name="flannel-container",id="/docker/4820b19743641b3eb4944cb9d320094b9a285fdf844aa74faf07ccd41b82b51c",image="sha256:79464014c9f2ef9a79f26e30c7872267c1df0636b7b8d0c365663ac4195bc143",name="k8s_flannel-container.ca562500_flannel-node1_kube-system_f5bdaa8218643115aecd3d98ef39a110_e86800bd",namespace="kube-system",pod_name="flannel-node1"} 540904
container_cpu_cfs_periods_total{container_name="kube-apiserver",id="/docker/b3c26b4a35ca877820753a415abf3b2985691c14be150b0ff22a6e1a1a09be2a",image="sha256:28059b43835189713fb7a7baaf6c2e1e531aa402d34efc4516f7783bc26d9f06",name="k8s_kube-apiserver.a8594391_kube-apiserver-node1_kube-system_104457c00a646d667198ed081c342a8a_c0cca1d1",namespace="kube-system",pod_name="kube-apiserver-node1"} 2.168493e+06
...

bug this no cadvisor service work on port 10255, anyone could help me how to get container metrics?

@jojohappy

This comment has been minimized.

Copy link
Contributor

jojohappy commented Jul 30, 2018

After Kubernetes 1.7, the scrape path of cAdvisor has been changed to /metrics/cadvisor, you should check your scrape configuration. You can try the example for kubernetes-prometheus here (https://github.com/prometheus/prometheus/blob/master/documentation/examples/prometheus-kubernetes.yml).

Another way that you can ask questions like this on the prometheus-users mailing list. You can get potentially respond to your question.

@simonpasquier

This comment has been minimized.

Copy link
Member

simonpasquier commented Jul 30, 2018

As @jojohappy pointed out (thanks!), it is better to use the prometheus-users mailing list or IRC for such requests. Since you already have a reply, I'm closing the issue for now.

@lock

This comment has been minimized.

Copy link

lock bot commented Mar 22, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Mar 22, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.