How do I group data together based on a label?

Hi all.

I’m trying to make a bar-gauge that shows per-CPU-core load using node_exporter.
I’ve found that node_cpu_seconds_total{mode!=“idle”} gives me the data for all non-idle processes, but it also outputs all seven categories of load individually, per core, of which I have 32.

Is there a way to get Grafana to sum together the seven categories and output one number for each core? Then I can use “CPU {{cpu}}” as the legend and all is as I want it.

I found the solution in the Prometheus documentation (doh)…

The PromQL query is sum by (cpu) (rate(node_cpu_seconds_total{mode!="idle"}[30s]))