Prometheus query for containers with id="/"

1,096 views
Skip to first unread message

avi.w...@gmail.com

unread,
Jul 28, 2018, 8:30:27 AM7/28/18
to Prometheus Users
Hi,

I am using Grafana dashbord from https://grafana.com/dashboards/4784 . It displays the overall memory and CPU of my Kubernetes cluster. Looking into the CPU usage query, I can see this:

sum (rate (container_cpu_usage_seconds_total{id="/",kubernetes_io_hostname=~"^$Node$"}[5m])) / sum (machine_cpu_cores{kubernetes_io_hostname=~"^$Node$"}) * 100

What does container with id="/" mean? It has only one metric in my system. It also does not have image (it is set with empty string):


Bert Hartmann

unread,
Jul 30, 2018, 9:00:10 AM7/30/18
to avi.w...@gmail.com, Prometheus Users

Hi Avi,

 

That’s kind of a confusingly named metric. That’s generated by cadvisor which reports on cgroups, and not just containers. The `id=”/”` is the lowest level cgroup namespace, which should report effectively system level metrics.

I’m trying to find documentation with more confirmation / detail about what’s reported, but nothing brief and relevant comes up, but hopefully that gives you enough to find and dive into more detailed docs.

The cadvisor docs may be a good place to start.

 

- Bert

--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
To post to this group, send email to promethe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/33bf4886-48c7-4808-a04a-a89a9e410ba8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages