Hello,

I am trying to represent in a Grafana dahboard the cumulative count of all 
Kubernetes pod phases per a list of nodes.
The metrics uses are from the kube-state-metrics project: 
https://github.com/kubernetes/kube-state-metrics/blob/v1.9.4/docs/pod-metrics.md

   - kube_pod_info
   - kube_pod_status_phase

The *kube_pod_status_phase* serie does not have a *node* label, while the 
*kube_pod_info* does.

I have tried to join the two series using the group_left function of 
Prometheus, but it seems that I can't conditionally select on the joined 
label.

My query currently looks like the following:

sum(sum(kube_pod_info{cluster_id="$region",node=~"$node"} * on(pod, 
namespace) group_right(node) kube_pod_status_phase{cluster_id="$region"}) by 
(node,phase)) by (phase)

I get the following as a result (taken from the Grafana panel legend):

kube_pod_status_phase{phase="Running"} 57
kube_pod_info{} 8
kube_pod_status_phase{phase="Pending"} 0
kube_pod_status_phase{phase="Failed"} 0
kube_pod_status_phase{phase="Unknown"} 0
kube_pod_status_phase{phase="Succeeded"} 0

I would like to count the number of pods (according to the selected nodes) 
grouped by pod phase.
What do I need to change to achieve that ?

Thanks

William

-- 
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-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/e0cd2f97-4750-4bea-be06-00681be1aa05%40googlegroups.com.

Reply via email to