How to join vectors with prometheus?

1/31/2019

It's probably something obvious but I don't seem to find a solution for joining 2 vectors in prometheus.

sum(
  rabbitmq_queue_messages{queue=~".*"}
) by (queue)
* 
on (queue) group_left max(
  label_replace(
    kube_deployment_labels{label_daemon_name!=""},
    "queue",
    "$1",
    "label_daemon_queue_name",
    "(.*)"
  )
) by (deployment, queue)

Below a picture of the output of the two separate vectors.

enter image description here

-- Enrico Stahn
kubernetes
prometheus

1 Answer

1/31/2019

Group left has the many on the left, so you've got the factors to the * the wrong way around. Try it the other way.

-- brian-brazil
Source: StackOverflow