Variable text interpolation


I’m trying to create an “Available” table column showing eg “2 of 4”
where 2 is the number of running pods and 4 is the total. I can get number of running pods from:
count(kube_pod_status_phase{phase =“Running”} == 1)
and total from:
count(kube_pod_status_phase{} == 1)

But how can I display both with “of” in between?

Many thanks

I couldn’t come up with a good way to do this. You can have two single stats - one with the running count and one with the total. But that’s not really what you are asking.

I have shared this with our UX team as it seems like a common pattern. We are working on configurable thresholds for Grafana 7.0 so maybe we can do something.