Thanks for your reply, this query works for me:
sum((sum without(exported_namespace) 
(label_replace(irate(haproxy_server_http_responses_total[5m]), "namespace", 
"$1", "exported_namespace","(.*)")))* on(namespace, route) group_left(host) 
openshift_route_info) by (code, namespace, route, host)

On Monday, September 28, 2020 at 10:48:40 PM UTC+3:30 [email protected] 
wrote:

> Hi,
> I guess you would need to rename the namespace label of the second query 
> to exported_namespace. or vice versa.
> try this example <https://stackoverflow.com/a/54833182/3544843>
> thanks
>
> On Mon, Sep 28, 2020 at 10:54 PM [email protected] <[email protected]> 
> wrote:
>
>> Hi
>> I would like to join two queries, one of them has labeled 
>> "exported_namespace" and "route", while the other one has "namespace" and 
>> "route" and "host"
>> Now I want to join these two queries so that "exported_namespace" from 
>> the first query should match "namespace" from the second query, and "route" 
>> from the first query should match "route" from the second query and the 
>> final metric should have labeled "exported_namespace" (or "namespace"), 
>> "route" and "host". 
>> I've already tried this query but it didn't give me any answer:
>> haproxy_server_http_responses_total * on(exported_namespace, route) 
>> openshift_route_info
>>
>> BTW, the first metric also has a label named "namespace" but the value is 
>> irrelevant to the actual namespace I'm looking for
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Prometheus Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected].
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/prometheus-users/810c860d-8bcc-4538-b38e-d8e3fe1b767fn%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/prometheus-users/810c860d-8bcc-4538-b38e-d8e3fe1b767fn%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/1f39ceea-f58e-4d4a-b916-152183798cf2n%40googlegroups.com.

Reply via email to