</code></pre></div></p><p>To enable or disable instrumentation for a single Ingress, use the <code>enable-opentracing</code> annotation: <divclass=highlight><pre><span></span><code>kind: Ingress
</code></pre></div></p><p>We must also set the host to use when uploading traces:</p><p><divclass=highlight><pre><span></span><code>zipkin-collector-host: zipkin.default.svc.cluster.local
</code></pre></div> NOTE: While the option is called <code>jaeger-collector-host</code>, you will need to point this to a <code>jaeger-agent</code>, and not the <code>jaeger-collector</code> component. Alternatively, you can set <code>jaeger-endpoint</code> and specify the full endpoint for uploading traces. This will use TCP and should be used for a collector rather than an agent.</p><p>Next you will need to deploy a distributed tracing system which uses OpenTracing. <ahref=https://github.com/openzipkin/zipkin>Zipkin</a> and <ahref=https://github.com/jaegertracing/jaeger>Jaeger</a> and <ahref=https://github.com/DataDog/dd-opentracing-cpp>Datadog</a> have been tested.</p><p>Other optional configuration options: <divclass=highlight><pre><span></span><code># specifies the name to use for the server span
</code></pre></div></p><p>All these options (including host) allow environment variables, such as <code>$HOSTNAME</code> or <code>$HOST_IP</code>. In the case of Jaeger, if you have a Jaeger agent running on each machine in your cluster, you can use something like <code>$HOST_IP</code> (which can be 'mounted' with the <code>status.hostIP</code> fieldpath, as described <ahref=https://kubernetes.io/docs/tasks/inject-data-application/downward-api-volume-expose-pod-information/#capabilities-of-the-downward-api>here</a>) to make sure traces will be sent to the local agent.</p><p>Note that you can also set whether to trust incoming spans (global default is true) per-location using annotations like the following: <divclass=highlight><pre><span></span><code>kind: Ingress
</code></pre></div></p><h2id=examples>Examples<aclass=headerlinkhref=#examplestitle="Permanent link"> ¶</a></h2><p>The following examples show how to deploy and test different distributed tracing systems. These example can be performed using Minikube.</p><h3id=zipkin>Zipkin<aclass=headerlinkhref=#zipkintitle="Permanent link"> ¶</a></h3><p>In the <ahref=https://github.com/rnburn/zipkin-date-server>rnburn/zipkin-date-server</a> GitHub repository is an example of a dockerized date service. To install the example and Zipkin collector run:</p><divclass=highlight><pre><span></span><code>kubectl create -f https://raw.githubusercontent.com/rnburn/zipkin-date-server/master/kubernetes/zipkin.yaml
</code></pre></div><p>Also we need to configure the Ingress-NGINX controller ConfigMap with the required values:</p><divclass=highlight><pre><span></span><code>$ echo '
</code></pre></div><p>In the Zipkin interface we can see the details: <imgalt="zipkin screenshot"src=../../../images/zipkin-demo.pngtitle="zipkin collector screenshot"></p><h3id=jaeger>Jaeger<aclass=headerlinkhref=#jaegertitle="Permanent link"> ¶</a></h3><ol><li><p>Enable Ingress addon in Minikube: <divclass=highlight><pre><span></span><code>$ minikube addons enable ingress
</code></pre></div></p></li><li><p>Add Minikube IP to /etc/hosts: <divclass=highlight><pre><span></span><code>$ echo "$(minikube ip) example.com" | sudo tee -a /etc/hosts
</code></pre></div></p></li><li><p>Apply a basic Service and Ingress Resource: <divclass=highlight><pre><span></span><code># Create Echoheaders Deployment
</code></pre></div></p></li><li><p>Apply the Jaeger All-In-One Template: <divclass=highlight><pre><span></span><code>$ kubectl apply -f https://raw.githubusercontent.com/jaegertracing/jaeger-kubernetes/master/all-in-one/jaeger-all-in-one-template.yml
</code></pre></div></p></li><li><p>Make a few requests to the Service: <divclass=highlight><pre><span></span><code>$ curl example.com/echo -d "meow"
</code></pre></div></p><p>In the Jaeger interface we can see the details: <imgalt="jaeger screenshot"src=../../../images/jaeger-demo.pngtitle="jaeger collector screenshot"></p></li></ol></article></div></div></main><footerclass=md-footer><divclass="md-footer-meta md-typeset"><divclass="md-footer-meta__inner md-grid"><divclass=md-copyright> Made with <ahref=https://squidfunk.github.io/mkdocs-material/target=_blankrel=noopener> Material for MkDocs </a></div></div></div></footer></div><divclass=md-dialogdata-md-component=dialog><divclass="md-dialog__inner md-typeset"></div></div><scriptid=__configtype=application/json>{"base":"../../..","features":["navigation.tabs","navigation.tabs.sticky","navigation.instant","navigation.sections"],"search":"../../../assets/javascripts/workers/search.f886a092.min.js","translations":{"clipboard.copied":"Copied to clipboard","clipboard.copy":"Copy to clipboard","search.result.more.one":"1 more on this page","search.result.more.other":"# more on this page","search.result.none":"No matching documents","search.result.one":"1 matching document","search.result.other":"# matching documents","search.result.placeholder":"Type to start searching","search.result.term.missing":"Missing","select.version":"Select version"}}</script><scriptsrc=../../../assets/javascripts/bundle.aecac24b.min.js></script></body></html>