Hi,
On 3/10/20 11:33 PM, BDT wrote:
> Today I have a problem about my rules expression because I try to join
> metrics together to get the name of the swam node in it.
To simplify: This is about "joining" some real-world metric with a meta
metric to get additional labels and the problem being that the meta
metric exists twice with different instance labels, right?
E.g.
container_memory_rss * on(container_label_com_docker_swarm_node_id)
group_left(node_name) node_meta
with
container_memory_rss{container_label_com_docker_swarm_node_id="foo"} 1234
node_meta{container_label_com_docker_swarm_node_id="foo",instance="a"} 1
node_meta{container_label_com_docker_swarm_node_id="foo",instance="b"} 1
The simplest way might be to aggregate away the instance label form
node_meta, which you don't seem to require:
container_memory_rss * on(container_label_com_docker_swarm_node_id)
group_left(node_name) sum ignoring(instance) (node_meta)
Kind regards,
Christian
--
You received this message because you are subscribed to the Google Groups
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/prometheus-users/68f9cb13-05f0-7a8b-df69-648acb427451%40hoffmann-christian.info.