<p>I have Kubernetes 1.17.5 and Istio 1.6.8 installed with demo profile.</p>
<p>And here is my test setup [nginx-ingress-controller] -&gt; [proxy&lt;-&gt;ServiceA] -&gt; [proxy&lt;-&gt;ServiceB]</p>
<ul>
<li>Proxies for serviceA and serviceB are auto-injected by Istio (istio-injection=enabled)</li>
<li>Nginx ingress controller does not have tracing enabled and has no envoy proxy as a sidecar</li>
<li>ServiceA passes tracing headers down to ServiceB</li>
<li>I'm trying to trace calls from ServiceA to ServiceB and do not care about Ingress-&gt;ServiceA span at the moment</li>
</ul>
<p>When I'm sending requests to ingress controller I can see that ServiceA receives all required tracing headers from the proxy</p>
<pre><code>x-b3-traceid: d9bab9b4cdc8d0a7772e27bb7d15332f
x-request-id: 60e82827a270070cfbda38c6f30f478a
x-envoy-internal: true
x-b3-spanid: 772e27bb7d15332f
x-b3-sampled: 0
x-forwarded-proto: http
</code></pre>
<p>Problem is <strong>x-b3-sampled</strong> is always set to 0 and no spans/traces are getting pushed to Jaeger</p>
<p>Few things I've tried</p>
<ol>
<li>I've added Gateway and VirtualService to ServiceA to expose it through Istio ingressgateway. When I send traffic through  ingressgateway everything works as expected. I can see traces [ingress-gateway]-&gt;[ServiceA]-&gt;[ServiceB] in the JaegerUI</li>
<li>I've also tried to install Istio with custom config and play with tracing related parameters with no luck.</li>
</ol>
<p>Here is the config I've tried to use</p>
<pre><code>apiVersion: install.istio.io/v1alpha1
kind: IstioOperator
spec:
  meshConfig:
    enableTracing: true
    defaultConfig:
      tracing:
        sampling: 100
  addonComponents:
    tracing:
      enabled: true
    grafana:
      enabled: false
    istiocoredns:
      enabled: false
    kiali:
      enabled: false
    prometheus:
      enabled: false
  values:
    tracing:
      enabled: true
    pilot:
      traceSampling: 100
</code></pre>

arkadi4
<p>After few days of digging I've figured it out. Problem is in the format of the <code>x-request-id</code> header that nginx ingress controller uses.</p>
<p>Envoy proxy expects it to be an UUID (e.g. <code>x-request-id: 3e21578f-cd04-9246-aa50-67188d790051</code>) but ingrex controller passes it as a non-formatted random string (<code>x-request-id: 60e82827a270070cfbda38c6f30f478a</code>). When I pass properly formatted x-request-id header in the request to ingress controller its getting passed down to envoy proxy and request is getting sampled as expected. I also tried to remove
x-request-id header from the request from ingress controller to ServiceA with a simple EnvoyFilter. And it also works as expected. Envoy proxy generates a new x-request-id and request is getting traced.</p>
