How to configure all Istio sidecars to return `x-b3-traceid` as a response header

Hey folks,

We’re currently using a self managed Istio installation in our GKE clusters (v1.10.2), and as part of configuring the ingress gateway access logs to work with Stackdriver’s log correlation feature, we would like to log the x-b3-traceid header which is sent to our HTTP services - all request logs emitted by our applications include this header as well.

Is it possible to configure an Istio VirtualService such that all sidecars in a given namespace return the x-b3-traceid header in their HTTP response as captured from the HTTP request?

Looking at the docs, I did see there is a way for me to return the response headers appropriately by doing something as shown below, but I’m not sure how to setup a single config such that it affects all sidecars in the namespace instead of needing to target individual services?

http:
- match:
- sourceNamespace: application
headers:
response:
set:
x-b3-traceid: “%REQ(x-b3-traceid)%”
x-request-id: “%REQ(x-request-id)%”

Not sure if this is covered by your documentation already so my apologies if I’ve missed something obvious.

Thanks!

Is this working. I also have similar requirement.