Connecting Grafana to Prometheus

Thanks a lot for the effort.

  1. container_cpu_user_seconds_total - Return data container_cpu_user_seconds_total{id=“/”,instance=“10.0.4.70:8080”,job=“cAdvisor”} 656.14

  2. rate(container_cpu_user_seconds_total[1m]) - Return data
    {id=“/”,instance=“10.0.4.70:8080”,job=“cAdvisor”} 0.0007272595043719863

3.rate(container_cpu_user_seconds_total{image!=“”}[1m]) - Return no data
4. sum(rate(container_cpu_user_seconds_total{image!=“”}[1m])) - Return no data
5. sort_desc(sum(rate(container_cpu_user_seconds_total{image!=“”}[1m]))) - Return no data

I will be happy to understand what that means and what has to be done to fix it.

There is no image label for container_cpu_user_seconds_total. It has id, instance and job labels. Why have you got image!="" in the query?

1 Like

You are correct!!! I just installed for the first time Grafana and used some of the dashboards referred there for docker. These dashboards are with pre build queries.
So I have removed the image part and it is working!!!Thanks a lot!!!
Any idea why did they added the image part?

I took a quick look at cAdvisor and it seems like it should add an image label by default:

Might be worth asking there or googling some more on how to configure cAdvisor.

1 Like

I will add additional docker instance and will se it it has any impact.
Also I will check there as well.

Thanks a lot it was a great help!!