How does binary operator vector matching work (`on`, `ignoring`, `group_left`)?

AdvancedConceptPromQL & Recording Rules
Answer

For a / b, Prometheus pairs series with identical label sets. To control it:

  • on(labels): match only on these labels.
  • ignoring(labels): match on all labels except these.
  • group_left / group_right: allow many-to-one matching and copy extra labels from the "one" side.
sum by (namespace, pod) (rate(container_cpu_usage_seconds_total[5m]))
* on (namespace, pod) group_left(team)
kube_pod_labels{label_team!=""}

The error many-to-many matching not allowed means the "one" side has duplicates for the match labels.

All Monitoring & Observability questions Roadmap: Monitoring & alerting

More on PromQL & Recording Rules