PromQL group_left 用法
所属分类 prometheus
浏览量 335
(avg by (instance) (rate(node_cpu_seconds_total{mode="iowait"}[5m])) * 100)
{instance="192.168.1.10:9103"} 0.0008771929824553427
{instance="192.168.1.11:9103"} 0.0008771929824553427
{instance="192.168.1.12:9103"} 0.004385964912280452
node_uname_info
node_uname_info{app="node-exporter",instance="192.168.1.10:9103",job="nodes",nodename="node10"} 1
node_uname_info{app="node-exporter",instance="192.168.1.11:9103",job="nodes",nodename="node11"} 1
node_uname_info{app="node-exporter",instance="192.168.1.12:9103",job="nodes",nodename="node12"} 1
(avg by (instance) (rate(node_cpu_seconds_total{mode="iowait"}[5m])) * 100) * on(instance) group_left (nodename) node_uname_info
{instance="192.168.1.10:9103",nodename="node10"} 0.0008771929824553427
{instance="192.168.1.11:9103",nodename="node11"} 0.0008771929824553427
{instance="192.168.1.12:9103",nodename="node12"} 0.004385964912280452
on(instance)
on(instance)
左右两边根据 instance 进行匹配 ,值相等才会进行运算
group_left (nodename)
group_left() 的参数是右侧的标签名,将此标签值传递给左侧,覆盖左侧同名标签
上一篇
下一篇
监控原则
一个URL请求的过程
Prometheus监控rabbitmq
rabbitmq 基础
nacos 配置安装
SpringCloud与SpringCloud Alibaba的区别