CPU Stats With Variable And All

I have a dashboard using Prometheus as my data source and a processor variable that gets all of the processors I am looking for. If I use Explore with this:


I get each CPU and all of the CPU usage for user. In my visual on the dashboard I use the following query:

cpu_usage_user{host=“$hostname”, cpu=“$processor”}

On my drop down variable for processor, if I pick say cpu0 it shows data. If I select all it show no data. What am I missing in either the query or the variable and where should I make my change?

No I am separating each one, such as cpu_usage_user as one query and then cpu_usage_system as another. What I am truing to do get each query to show all when I select it from my dashboard variable:



try the tilda method ~ for all

So I would do cpu_usage_user{host=“$hostname”, cpu=~“$processor”}. That was it! Thanks as always!

1 Like

Well that’s sort of it. Now it show all processors as all. Not as a total by itself:


I kinda got it. However I want to limit from CPU 0-9. I put this in my dashboard variable:

But these show up as the result:

you need to fix that regex