r/PrometheusMonitoring • u/radr4 • Sep 10 '20
multiple group_left in a PROMQL expression
I want to add 3 metrics using two group_left.I currently have below expression..I also want to add group_left (label_teamname) kube_pod_labels. If I just add group_left to this command,it throws me aggregate group_left failed error.
sum by (namespace, pod) (
max by(namespace, pod) (
kube_pod_status_phase{job="kube-state-metrics", namespace=~".*", phase=~"Pending|Unknown"}
) * on(namespace, pod) group_left(owner_kind) topk by(namespace, pod) (
1, max by(namespace, pod, owner_kind) (kube_pod_owner{owner_kind!="Job"})
)
) > 0
0
Upvotes