I would like to filter a query to only values in a metric where a label for that metric exists as a label in another metric. In SQL this would look like:
SELECT * FROM metric1 where metric1.label1 IN (SELECT label2 from metric2);
Is this possible in PromQL?
I have tried using the ON operator, but this doesn't seem to do what I intend.
I was able do what I wanted using label_replace (thank you markalex).
metric1 and on (label1) label_replace(metric2, label1, "$1", label2, "(.+)")