之前查询container mem已经使用的mem,都是使用的是container_memory_usage_bytes,直到早上看到openshift监控平台在查询container mem usage的时候使用的container_memory_working_set_bytes。
cadvisor官方给出的metrics文档:
https://github.com/google/cadvisor/blob/master/docs/storage/prometheus.md
mem相关的指标
https://medium.com/faun/how-much-is-too-much-the-linux-oomkiller-and-used-memory-d32186f29c9d
以上两篇文章有解释为什么用container_memory_working_set_bytes, 而不用container_memory_usage_bytes。
container_memory_usage_bytes包含了cache,如filesystem cache,当存在mem pressure的时候能够被回收。
container_memory_working_set_bytes 更能体现出mem usage,oom killer也是根据container_memory_working_set_bytes 来决定是否oom kill的。
sum(container_memory_working_set_bytes{name!~"POD"}) by (name)
disk io
sum(rate(container_fs_writes_bytes_total[5m])) by (container_name,device)
sum(rate(container_fs_reads_bytes_total[5m])) by (container_name,device)
net io
sum(rate(container_network_receive_bytes_total[5m])) by (name)
sum(rate(container_network_transmit_bytes_total[5m])) by (name)