type: Singlestat
Unit: perent(0-100)
(全部 cpu使用狀況 - 5分鐘內 cpu 空閒的平均值) / 全部 cpu使用狀況
metrics:
(((count(count(node_cpu_seconds_total{instance=~\"$node:$port\",job=~\"$job\"}) by (cpu))) - avg(sum by (mode)(irate(node_cpu_seconds_total{mode='idle',instance=~\"$node:$port\",job=~\"$job\"}[5m])))) * 100) / count(count(node_cpu_seconds_total{instance=~\"$node:$port\",job=~\"$job\"}) by (cpu))
最大值: 100%
node
type: Singlestat
Unit: perent(0-100)
已使用的內存佔比(包括Buffer緩存和Cached緩存)
metrics:
((node_memory_MemTotal_bytes{instance=~\"$node:$port\",job=~\"$job\"} - node_memory_MemFree_bytes{instance=~\"$node:$port\",job=~\"$job\"}) / (node_memory_MemTotal_bytes{instance=~\"$node:$port\",job=~\"$job\"} )) * 100
node_memory_MemFree_bytes 空閒內存
已使用的內存佔比(不包括Buffer緩存和Cached緩存)
metrics:
100 - ((node_memory_MemAvailable_bytes{instance=~"$node:$port",job=~"$job"} * 100) / node_memory_MemTotal_bytes{instance=~"$node:$port",job=~"$job"})
MemAvailable: Free + Buffers + Cached - 不可回收的部分。不可回收部分包括:共享內存段,tmpfs,ramfs等
緩存
type: Singlestat
Unit: perent(0-100)
metrics:
((node_memory_SwapTotal_bytes{instance=~\"$node:$port\",job=~\"$job\"} - node_memory_SwapFree_bytes{instance=~\"$node:$port\",job=~\"$job\"}) / (node_memory_SwapTotal_bytes{instance=~\"$node:$port\",job=~\"$job\"} )) * 100
node_memory_SwapFree_bytes 交換分區的空閒大小spa
type: Singlestat
Unit: perent(0-100)
metrics:
100 - ((node_filesystem_avail_bytes{instance=~"$node:$port",job=~"$job",mountpoint="/",fstype!="rootfs"} * 100) / node_filesystem_size_bytes{instance=~"$node:$port",job=~"$job",mountpoint="/",fstype!="rootfs"})
node_filesystem_avail_bytes 文件系統可用空間內存
type: Singlestat
Unit: perent(0-100)
metrics:
avg(node_load1{instance=~"$node:$port",job=~"$job"}) / count(count(node_cpu_seconds_total{instance=~"$node:$port",job=~"$job"}) by (cpu)) * 100
node_load1 : 系統一分鐘內的負載it
type: Singlestat
Unit: perent(0-100)
metrics:
avg(node_load5{instance=~"$node:$port",job=~"$job"}) / count(count(node_cpu_seconds_total{instance=~"$node:$port",job=~"$job"}) by (cpu)) * 100
node_load5 : 指5分鐘內cpu的負載sed
type: Singlestat
Unit: perent(0-100)
(全部 cpu使用狀況 - 5分鐘內 cpu 空閒的平均值) / 全部 cpu使用狀況
metrics:
(((count(count(node_cpu_seconds_total{instance=~\"$node:$port\",job=~\"$job\"}) by (cpu))) - avg(sum by (mode)(irate(node_cpu_seconds_total{mode='idle',instance=~\"$node:$port\",job=~\"$job\"}[5m])))) * 100) / count(count(node_cpu_seconds_total{instance=~\"$node:$port\",job=~\"$job\"}) by (cpu))
最大值: 100%
file
type: Singlestat
Unit: perent(0-100)
已使用的內存佔比(包括Buffer緩存和Cached緩存)
metrics:
((node_memory_MemTotal_bytes{instance=~\"$node:$port\",job=~\"$job\"} - node_memory_MemFree_bytes{instance=~\"$node:$port\",job=~\"$job\"}) / (node_memory_MemTotal_bytes{instance=~\"$node:$port\",job=~\"$job\"} )) * 100
node_memory_MemFree_bytes 空閒內存
已使用的內存佔比(不包括Buffer緩存和Cached緩存)
metrics:
100 - ((node_memory_MemAvailable_bytes{instance=~"$node:$port",job=~"$job"} * 100) / node_memory_MemTotal_bytes{instance=~"$node:$port",job=~"$job"})
MemAvailable: Free + Buffers + Cached - 不可回收的部分。不可回收部分包括:共享內存段,tmpfs,ramfs等
cpu
type: Singlestat
Unit: perent(0-100)
metrics:
((node_memory_SwapTotal_bytes{instance=~\"$node:$port\",job=~\"$job\"} - node_memory_SwapFree_bytes{instance=~\"$node:$port\",job=~\"$job\"}) / (node_memory_SwapTotal_bytes{instance=~\"$node:$port\",job=~\"$job\"} )) * 100
node_memory_SwapFree_bytes 交換分區的空閒大小filesystem
type: Singlestat
Unit: perent(0-100)
metrics:
100 - ((node_filesystem_avail_bytes{instance=~"$node:$port",job=~"$job",mountpoint="/",fstype!="rootfs"} * 100) / node_filesystem_size_bytes{instance=~"$node:$port",job=~"$job",mountpoint="/",fstype!="rootfs"})
node_filesystem_avail_bytes 文件系統可用空間文件
type: Singlestat
Unit: perent(0-100)
metrics:
avg(node_load1{instance=~"$node:$port",job=~"$job"}) / count(count(node_cpu_seconds_total{instance=~"$node:$port",job=~"$job"}) by (cpu)) * 100
node_load1 : 系統一分鐘內的負載
type: SinglestatUnit: perent(0-100)metrics: avg(node_load5{instance=~"$node:$port",job=~"$job"}) / count(count(node_cpu_seconds_total{instance=~"$node:$port",job=~"$job"}) by (cpu)) * 100 node_load5 : 指5分鐘內cpu的負載