Why is this Prometheus variable query not valid?

Hi all,

I am trying to set up a new variable based on a Prometheus query, however it’s not accepting what I feel is a valid query.

This query:

kube_pod_info{namespace=~"stack-review-.*"}

is valid, however it shows me many false positives.

This is the query I want to use:

count(kube_pod_info{namespace=~"stack-review-.*"}) by (namespace)

as it completely removes the false positives and gives me exactly what I want when running it directly in Prometheus, however it gives me this error:

Screenshot-2021-09-17-15:29:45

Can I have some pointers as to what I am doing wrong?

Thank you!

still blocked on this, @matthewcane?