multiple group_left in an expression

12 views
Skip to first unread message

radhamani...@gmail.com

unread,
Sep 10, 2020, 3:16:46 PM9/10/20
to Prometheus Users

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

Reply all
Reply to author
Forward
0 new messages