阿里云的 Prometheus 使用 container_memory_working_set_bytes 来进行告警设置 container_memory_working_set_bytes 是容器真实使用的内存量,也是资源限制limit时的重启判断依据 # 进入容器 pod 内部,获取到的pod内存数据:cat/sys/fs/cgroup/memory/memory.stat# 重要说明
container_memory_working_set_bytes 容器使用内存 更能体现出mem usage,也是oom killer指标(建议使用) container_spec_memory_limit_bytes: 容器的内存使用量限制,当k8s中的确认 CPU使用率: 表达式1:sum(irate(container_cpu_usage_seconds_total{container !="",container!="POD"}[2m])) by (container, pod) ...
metric: name: container_memory_working_set_bytes_per_second # AverageValue类型的目标值,Pods指标类型下只支持AverageValue类型的目标值。 target: type: AverageValue averageValue: 1024000m # 此处1024000m代表1 KB内存阈值,当前指标单位为byte/per second,m为K8s转换精度单位,当出现了小数点,...
description: "容器cpu使用率超过300%,当前值为:{{ $value }}" - alert: ContainerMemoryUsage expr: (sum(container_memory_working_set_bytes{name!=""})BY (instance, name) /sum(container_spec_memory_limit_bytes > 0) BY (instance, name) * 100 ) > 80 for: 2m labels: severity: warning an...
container_memory_working_set_bytes{<<.LabelMatchers>>,container!="",pod!=""} ) "nodeQuery": | sum by (<<.GroupBy>>) ( node_memory_working_set_bytes{<<.LabelMatchers>>} ) "resources": "overrides": "node": "resource": "node" ...
container_memory_working_set_bytes 这个指标更能表达内存的使用情况,容器oom killer也是根据container_memory_working_set_bytes 来决定是否oom kill的 container_memory_usage_bytes 这个指标显示的内存 包括了container_memory_cache,不能准确的反映容器真实内存使用量 ...
container_fs_reads_total container_fs_writes_total container_fs_reads_bytes_total container_fs_writes_bytes_total container_memory_working_set_bytes container_memory_cache container_memory_swap container_cpu_cfs_throttled_periods_total container_cpu_cfs_periods_total ...
- alert: pod 内存使用率 expr:(sum(container_memory_working_set_bytes{container!="POD",name!=""})BY(instance, namespace,pod)/ sum(container_spec_memory_limit_bytes>0)BY(instance, namespace,pod)*100)>95for: 2m labels: severity: warning annotations: summary: Container Memory usage(instance...
container_memory_swap gauge 字节数bytes 虚拟内存使用量。虚拟内存(swap)指的是用磁盘来模拟内存使用。当物理内存快要使用完或者达到一定比例,就可以把部分不用的内存数据交换到硬盘保存,需要使用时再调入物理内存 container_memory_working_set_bytes gauge 字节数bytes 当前内存工作集(working set)使用量。 container...
其中,container_cpu_usage_seconds_total()给出了CPU被占用的时间,rate()计算范围向量中时间序列的每秒平均增长率,sum() by (pod_name)添加包含相同pod名称的所有值。 如果要计算每个pod的工作负载内存利用率,可以使用以下PromQL查询语句: sum(container_memory_working_set_bytes{namespace="namespace",podname= ...