How to correlate kube_pod_info and kube_pod_status_phase

The image “quay.io/coreos/kube-state-metrics:v1.1.0” is used to collect kubernetes metrics. What I want is to get each pod’s info and status displayed on a grafana table, the format of which is as below,
pod
node
host_ip
pod_ip
phase

I can get (pod, node, host_ip, pod_id) from the metrics kube_pod_info, and get (pod, phase) from kube_pod_status_phase. Currently I created two grafana tables to display them separately. But I really want to get them displayed in one table. How can I achieve this?

The other question is how to remove the metrics value column from the table, because I only care about the labels.

The grafana version is v4.6.2, prometheus version is v2.0.0.

Hi,

There have been work around this that have been merged to Grafana master lately.

Please see this PR and this PR.

You can try out one of the Grafana nightly builds to test this new functionality,

You should be able to hide the Metric column using the tab Column Styles, filter out the Metric column and assign the type Hidden.

Marcus

Thanks a lot, it’s really what I want.

The following PromQL query adds phase label from kube_pod_status_phase to the list of labels obtained from kube_pod_info metric:

kube_pod_info * on(pod) group_left(phase) kube_pod_status_phase

See these docs about on and group_left modifiers. See also this article.