In your case 1,
clusterName=" $clustername|"
should be
clusterName=~" $clustername|"Your screenshot shows this mistake as well.
You stated "Below query is not at all working as it contains other condition in beginning." I think you need to clarify both parts of that statement:
(1) in what way is it not working? Show the input metrics, the result of the query, and what result you're actually looking for.
If the problem is that it returns an empty result set (as per your screenshot), that's because you used the wrong label match operator, "=" instead of "=~". It will only match a clusterName which has the exact literal value "d3-prd-w2|" (including the vertical bar).
(2) "as it contains other condition in beginning" doesn't mean anything to me. What conditions? Do you mean the label filter type="cds"?
Then clearly it will only match metrics that have that label. Is that not what you want?
In your case 3, I think you have another bug:
(kube_pod_info{k8s_cluster=~"$clustername"} or {clusterName=~"$clustername"})
should be
(kube_pod_info{k8s_cluster=~"$clustername"} or kube_pod_info{clusterName=~"$clustername"})
> OR is not working in all cases due to binary expressions in queries
That doesn't mean anything. The semantics of the OR operator are clearly defined. Show examples of what metrics you are feeding into this query, what you get as the output, and what you would *like* to see instead, and we may be able to help you formulate a query that does what you want.
In other words, the problem is not that "OR is not working" - the problem is that you haven't formulated your PromQL query in a way which gets you the results you're looking for.
> Could you please look into this issue on high priority
(however, the whole of that document is well worth reading)