Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cAdvisor prometheus integration returns container_cpu_load_average_10s as 0

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?

Prometheus version: 2.1.0

Prometheus config:

scrape_configs: - job_name: cadvisor scrape_interval: 5s metrics_path: /metrics scheme: http static_configs: - targets: - 172.17.0.2:8080

cAdvisor version: 0.29.0

like image 444
aries Avatar asked Mar 03 '18 10:03

aries


People also ask

What is cAdvisor in Prometheus?

cAdvisor with Prometheus and Grafana Prometheus is a metrics server that scrapes and stores metrics from different sources, including Kubernetes nodes and individual containers. Since you want to collect the metrics related to containers, you'll be using cAdvisor in this example.

What is cAdvisor exporter?

cAdvisor (Container Advisor) provides container users an understanding of the resource usage and performance characteristics of their running containers. It is a running daemon that collects, aggregates, processes, and exports information about running containers.


1 Answers

In order to get the metric container_cpu_load_average_10s, the cAdvisor must run with the option

--enable_load_reader=true

which is set fo false by default. This is described here.

like image 191
aries Avatar answered Oct 10 '22 11:10

aries