我有以下两个指标
namedprocess_namegroup_cpu_seconds_total{groupname="group_name", instance="0.0.0.0:0000", job="process_monitor_master", mode="user"}
namedprocess_namegroup_cpu_seconds_total{groupname="group_name",instance="0.0.0.0:0000",job="process_monitor_k8_nodes",mode="system"}
node_uname_info{domainname="domain",instance="0.0.0.0:0000",job="sandbox_cluster"}
node_uname_info{domainname="domain",instance="0.0.0.0:0000",job="sandbox_master"}
我想获取职位名称并将其存储在变量 job 中,我该如何结合以下两个查询
label_values(namedprocess_namegroup_cpu_seconds_total,job)
label_values(node_uname_info, job)
答案 0 :(得分:2)
label_values({__name__=~ "namedprocess_namegroup_cpu_seconds_total|node_uname_info"}, job)
指标|指标
之间没有空格