码迷,mamicode.com
首页 > 其他好文 > 详细

Prometheus Node_exporter 之 Basic CPU / Mem Graph

时间:2019-03-05 21:41:24      阅读:214      评论:0      收藏:0      [点我收藏+]

标签:大小   instance   strong   用户态   mode   交换   size   port   内存   

1. CPU Basic cpu 的基本信息 /proc/stat

type: Graph
Unit: short
Busy System: cpu 处于核心态的占比

metrics:

sum by (instance)(rate(node_cpu_seconds_total{mode="system",instance=~"$node:$port",job=~"$job"}[5m])) * 100


Busy User: cpu 处于用户态的占比

metrics:

sum by (instance)(rate(node_cpu_seconds_total{mode=‘user‘,instance=~"$node:$port",job=~"$job"}[5m])) * 100


Busy Iowait: cpu 处于 io 等待的时间占比

metrics:

sum by (instance)(rate(node_cpu_seconds_total{mode=‘iowait‘,instance=~"$node:$port",job=~"$job"}[5m])) * 100


Busy IRQs: cpu 处于中断状态占比

metrics:

sum by (instance)(rate(node_cpu_seconds_total{mode=~".*irq",instance=~"$node:$port",job=~"$job"}[5m])) * 100


Idle: cpu 处于空闲状态占比

metrics:

sum by (mode)(rate(node_cpu_seconds_total{mode=‘idle‘,instance=~"$node:$port",job=~"$job"}[5m])) * 100


Busy Other: cpu 处于其他状态占比(非系统状态、非用户态、非io等待状态、非空闲态、非中断状态)

metrics:

sum (rate(node_cpu_seconds_total{mode!=‘idle‘,mode!=‘user‘,mode!=‘system‘,mode!=‘iowait‘,mode!=‘irq‘,mode!=‘softirq‘,instance=~"$node:$port",job=~"$job"}[5m])) * 100


2. Memory Basic 内存基本信息


type: Graph
Unit: short
RAM Total: 内存大小

metrics:

node_memory_MemTotal_bytes{instance=~"$node:$port",job=~"$job"}


RAM Used: 已使用的内存大小(内存总量-空闲的内存大小-Buffer缓存和Cached缓存占的内存大小)

metrics:

node_memory_MemTotal_bytes{instance=~"$node:$port",job=~"$job"} - node_memory_MemFree_bytes{instance=~"$node:$port",job=~"$job"} - (node_memory_Cached_bytes{instance=~"$node:$port",job=~"$job"} + node_memory_Buffers_bytes{instance=~"$node:$port",job=~"$job"})


RAM Cache + Buffer: Cached缓存占的内存大小

metrics:

node_memory_Cached_bytes{instance=~"$node:$port",job=~"$job"} + node_memory_Buffers_bytes{instance=~"$node:$port",job=~"$job"}


RAM Free: 空闲的内存大小

metrics:

node_memory_MemFree_bytes{instance=~"$node:$port",job=~"$job"}


SWAP Used: 已使用的交换内存的大小

metrics:

(node_memory_SwapTotal_bytes{instance=~"$node:$port",job=~"$job"} - node_memory_SwapFree_bytes{instance=~"$node:$port",job=~"$job"})
交换分区的总大小- 空闲大小

 

Prometheus Node_exporter 之 Basic CPU / Mem Graph

标签:大小   instance   strong   用户态   mode   交换   size   port   内存   

原文地址:https://www.cnblogs.com/qianyuliang/p/10479585.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!