title: How would I graph cpu usage in grafana using Prometheus and the collectd exporter?
body: <p>New to promql and I'm trying to graph cpu usage over time and I've found the following example getting a static percent of usage but how would I convert it to a rate for grafana?</p>
  
  <pre><code>100 * (1 - sum(collectd_cpu_total{type="idle"}) by (exported_instance) / sum(collectd_cpu_total) by (exported_instance))
  </code></pre>
  
  <p>I got this example from <a href="https://github.com/Naugrimm/promql-examples" rel="nofollow noreferrer">https://github.com/Naugrimm/promql-examples</a></p>