问题描述
我已将Prometheus配置为从cAdvisor抓取指标.但是,度量标准"container_cpu_load_average_10s"仅返回0.我能够在cAdvisor Web UI下正确看到CPU度量标准,但Prometheus仅接收0.对于其他度量标准(如"container_cpu_system_seconds_total"),它工作正常.有人可以指出我是否在这里遗漏了什么?
I have configured Prometheus to scrape metrics from cAdvisor. However, the metric "container_cpu_load_average_10s" only returns 0. I am able to see the CPU metrics under the cAdvisor web UI correctly but Prometheus receives only 0. It is working fine for other metrics like "container_cpu_system_seconds_total". Could someone point if I am missing something here?
普罗米修斯版本:2.1.0
Prometheus version: 2.1.0
Prometheus配置:
Prometheus config:
scrape_configs:- job_name: cadvisor scrape_interval: 5s metrics_path: /metrics scheme: http static_configs: - targets: - 172.17.0.2:8080
scrape_configs:- job_name: cadvisor scrape_interval: 5s metrics_path: /metrics scheme: http static_configs: - targets: - 172.17.0.2:8080
cAdvisor版本:0.29.0
cAdvisor version: 0.29.0
推荐答案
为了获取指标container_cpu_load_average_10s
,cAdvisor必须与选项一起运行
In order to get the metric container_cpu_load_average_10s
, the cAdvisor must run with the option
--enable_load_reader=true
,默认情况下设置为false.在此处中进行描述.
which is set fo false by default. This is described here.
这篇关于cAdvisor普罗米修斯集成返回container_cpu_load_average_10s为0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!