Some of our Grafana dashboards contain queries that take time to load, and also seem the stress the Prometheus server itself.
One example, CPU Usage
sum(rate(node_cpu{role="$role",node=~"$node"}[$interval])) by (mode) * 100 / count_scalar(node_cpu{mode="user", role="$role", node=~"$node"}) or sum(irate(node_cpu{role="$role",node=~"$node"}[5m])) by (mode) * 100 / count_scalar(node_cpu{mode="user", role="$role",node=~"$node"})
As recording rules are processed by Prometheus, and are unaware of Grafana templating/variables - what is the recommended process for migrating this query into recording rules?
Should we be doing so?
Thanks kindly.