Recording rule advice for Grafana dashboards

507 views
Skip to first unread message

blakout

unread,
Mar 22, 2017, 5:51:54 PM3/22/17
to Prometheus Users
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.

Julius Volz

unread,
Mar 23, 2017, 9:03:32 AM3/23/17
to blakout, Prometheus Users
There's no automatic way of transforming your dashboard expressions into Prometheus rules, so doing this manually is unfortunately the way to go. Sometimes one might also not want to add the full dashboard expressions directly as rules, but common expensive subexpressions that are shared between graphs, etc.

--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/fe680a8b-6b3e-4bf2-99bf-3190f010cf2e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages