Enrich metrics from other metrics

47 views
Skip to first unread message

Kishore Chopne

unread,
Apr 3, 2023, 5:37:38 AM4/3/23
to promethe...@googlegroups.com
Hi,
I am trying to enrich some metrics from another metric using left join. However I do not want to hardcode any values in my recording rule.
I keep getting errors.
Execution: found duplicate series for the match group on the right hand-side of the operation. Many too many matching not allowed: matching labels must be unique on one side.
How can I make my recording rule unique.

/Kishore

Brian Candler

unread,
Apr 3, 2023, 7:50:51 AM4/3/23
to Prometheus Users
We can't give a specific answer unless you show the query you're doing, and the metrics which it uses (that is, all the metrics for the LHS and RHS, complete with their full set of labels)

Otherwise, all I can give is the generic answer which explains the error message. If you do

    foo * on (baz,qux) group_left (bap) bar

then for every unique combination of baz and qux label values, there must be exactly one instance of 'bar' with those labels. (Or zero, but then the values of 'foo' with those labels will be ignored in the query results)

Therefore, if you are getting the error "many to many matching not allowed", it means there are multiple instance of bar with the same set of join labels. For example, like this:
bar{baz="aaa",qux="bbb",instance="hello"}
bar{baz="aaa",qux="bbb",instance="world"}

IIRC, the full error message *does* say which metric and labels are faulty.
Reply all
Reply to author
Forward
0 new messages