Many-to-One Matching

When one side has more labels than the other, use group_left or group_right.
Example: per-core CPU usage. The CPU metric has a mode label, but demo_num_cpus does not:
rate(demo_cpu_usage_seconds_total{job="demo"}[5m])
/ on(job, instance) group_left
demo_num_cpus{job="demo"}
on(job, instance) — match only on these shared labels.
group_left — the left side has extra labels (like mode), so allow many-to-one matching.
Use group_right when the right side has more labels.
Rules of thumb:
group_left = left side is the "many" side (has extra dimensions)
group_right = right side is the "many" side
- Always pair with
on() or ignoring() to specify matching labels
- This is an advanced feature — often
without() or by() aggregation can achieve the same result more simply