<p>I need to get CPU and Memory usage in kubernetes pods with prometheus queries. Can someone plz help?</p>

GihanS
<p>For CPU percentage</p>
<pre><code>avg((sum (rate (container_cpu_usage_seconds_total {container_name!=&quot;&quot; ,pod=&quot;&lt;Pod name&gt;&quot; } [5m])) by (namespace , pod, container ) / on (container , pod , namespace) ((kube_pod_container_resource_limits_cpu_cores &gt;0)*300))*100)
</code></pre>
<p>For Memory percentage</p>
<pre><code>avg((avg (container_memory_working_set_bytes{pod=&quot;&lt;pod name&gt;&quot;}) by (container_name , pod ))/ on (container_name , pod)(avg (container_spec_memory_limit_bytes&gt;0 ) by (container_name, pod))*100)
</code></pre>
<p>you can use above promql with pod name in a query.</p>
