需求描述:
instance:node_cpu_utilisation:rate5m{}这个指标中值记录每个ecs节点的cpu使用率。
elasticsearch_cluster_health_number_of_nodes{}这个指标只记录es集群名和节点ip。
如果我想知道某个es集群名+节点IP的cpu使用率,怎么办呢
实现:
通过on进行join查询,通过group left或group right保留哪边的标签信息
avg(elasticsearch_cluster_health_number_of_nodes{instance='10.*.*.134'})by (instance,cluster)*0 + on(instance) group_left instance:node_cpu_utilisation:rate5m{}
如果还不懂,可以看看我的另一个sql介绍基础篇了解下。