get CPU usage of all the namespaces

970 views
Skip to first unread message

Darshil Saraiya

unread,
Aug 4, 2017, 4:55:14 PM8/4/17
to Prometheus Developers
I am using prometheus 1.7.0 and kubernetes 1.6.7.

I used memory metrics and got results of all the namespaces

sum by (namespace) (kube_pod_container_resource_limits_memory_bytes)

ElementValue
{namespace="kube-system"}178257920
{namespace="monitoring"}1029701632



So, I got different namesapces in this query

But, when I used cpu metrics, I got the results only containing "monitoring" namespace:

sum by (namespace) (kube_pod_container_resource_limits_cpu_cores)

ElementValue
{namespace="monitoring"}1.525


 
Where I have these namespaces:

$ kubectl get ns


NAME          STATUS    AGE


default       Active    1h


kube-public   Active    1h


kube-system   Active    1h


monitoring    Active    25m



So, Should I use this https://www.weave.works/blog/aggregating-pod-resource-cpu-memory-usage-arbitrary-labels-prometheus/ and add Scarping in config file and then get the info about different namespaces or is something not right in these results?

Callum Styan

unread,
Aug 4, 2017, 6:32:15 PM8/4/17
to Darshil Saraiya, Prometheus Developers
Please use prometheus-users (https://groups.google.com/forum/#!forum/prometheus-users) for usage related questions. This mailing list is for discussions related to development of Prometheus itself.

--
You received this message because you are subscribed to the Google Groups "Prometheus Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-developers+unsub...@googlegroups.com.
To post to this group, send email to prometheus-developers@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-developers/98877768-fb8d-449e-ae67-fd337bbc3a7d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages