title: Average Memory Usage Query - Prometheus
body: <p>How do I write a query that outputs average memory usage for instances over the past 24 hours?
  The following query displays the current memory usage</p>
  
  <pre><code>100 * (1 - ((node_memory_MemFree + node_memory_Cached + node_memory_Buffers) / node_memory_MemTotal))
  </code></pre>
  
  <p>For CPU, I was able to use irate</p>
  
  <pre><code>100 * (1 - avg(irate(node_cpu[24h])) BY (instance))
  </code></pre>
  
  <p>How do I use irate and avg for memory?</p>