<p>I am trying to find min/max/average memory consumed by particular pod over a time inteval.</p>
<p>Currently I am using</p>
<pre><code>sum(container_memory_working_set_bytes{namespace=&quot;test&quot;, pod=&quot;test1&quot;, container!=&quot;POD&quot;, container!=&quot;&quot;}) by (container)

Output -&gt; test1 = 9217675264
</code></pre>
<p>For report purpose, I need to find what the min/peak memory used by pod over a time interval ( 6h)
and average too.</p>

<p>You can do that with a range vector (add an <code>[interval]</code> to a metric name/selector) and an <a href="https://prometheus.io/docs/prometheus/latest/querying/functions/#aggregation_over_time" rel="nofollow noreferrer">aggregation-over-time function</a>:</p>
<pre><code>min_over_time(container_memory_usage_bytes{}[6h])
max_over_time(container_memory_usage_bytes{}[6h])
avg_over_time(container_memory_usage_bytes{}[6h])
</code></pre>
