grafana prometheus use legend from other series -
have following series , want use host[host] legend instead of instance. can help?
first one:
node_load1{instance=~"$node"}node_load1{instance="10.42.220.165:9100",job="hostsmetrics"}
and second one:
host{instance=~"$node"}host{host="srv02.example.com",instance="10.42.220.165:9100",job="hostsmetrics",node="prometheus-node-exporter-2"}
it looks searching vector matching. there nice blog post robust perception here seems describes solution problem.
in short, assuming second metric has value of 1 should able this:
node_load1{instance=~"$node"} * on (instance) group_left(host) host{instance=~"$node"} this add host label host metric resulting vector.
hope helps.
in case need more labels added resulting vector add group_left(host) part group_left(host, node).
Comments
Post a Comment