content_image/993515.jpg
<img src='content_image/993515.jpg'>

Here we can see the overall memory consumption for the whole container, not just the JVM heap usage. The query in Example 5-6 also displays the current memory usage in GB. 

sum(container_memory_working_set_bytes{pod_name=~"logging-elk-.+",container_name=~ "es-.+|logstash"}) by (pod_name) 

Example 5-7 shows a query for viewing the average rate of the current CPU usage of the same Elasticsearch containers, also providing valuable information about how accurate the CPU resource allocation is in this cluster. 

sum(rate(container_cpu_usage_seconds_total{pod_name=~"logging-elk-.+",container_na me=~"es-.+|logstash"}[2m])) by (pod_name) 

Figure 5-11 on page 170 shows the output of this query for this cluster. 

