I don't have access to a Prometheus UI, the underlying platform uses 
Warp10, and my queries are transformed from PromQL to WarpScript.

I successfully obtained the desired output using the following query:

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


Le mercredi 3 juin 2020 09:02:57 UTC+2, Matthias Rampke a écrit :
>
> The second query looks right (and works if I plug it into my Prometheus) – 
> I don't know what Grafana is doing with it though. I would recommend 
> solving one problem at a time; does the query work as you expect when you 
> use the built in Prometheus query UI? If so, it is a problem with the panel 
> configuration. If not, you can tweak it there, then come back to the panel 
> once you have the underlying data in shape.
>
> /MR
>
> On Tue, Jun 2, 2020 at 10:35 PM Poussier William <[email protected] 
> <javascript:>> wrote:
>
>>  I have simplified the query to the following:
>> sum(kube_pod_status_phase{cluster_id="$region"} * on (namespace,pod) 
>> group_left(node) kube_pod_info{cluster_id="$region",node=~"$node"}) by (
>> node,phase)
>>
>> Still facing the same issue, there is two series in the return.
>> Grafana is displaying the following as table:
>>
>> kube_pod_status_phase{phase="Running"} 57
>> kube_pod_info{node="worker-002"} 8
>> kube_pod_info{node="worker-001"} 8
>> kube_pod_info{node="worker-003"} 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
>>
>> The values of the kube_pod_info series here are actually representing the 
>> right data value per node for the "Running" phase.
>>
>> -- 
>> 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 [email protected] <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/prometheus-users/aede4847-2944-42b1-bbb9-fa1aeffdeed2%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/prometheus-users/aede4847-2944-42b1-bbb9-fa1aeffdeed2%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/39d91c52-705a-404c-98f7-3ded07a36e58%40googlegroups.com.

Reply via email to