istio.io/archive/v1.4/faq/distributed-tracing/index.html

40 lines
24 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!doctype html><html lang=en itemscope itemtype=https://schema.org/WebPage><head><meta charset=utf-8><meta http-equiv=x-ua-compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name=theme-color content=#466BB0><meta name=title content="Distributed Tracing FAQ"><meta name=description content="Distributed Tracing Q &amp; A."><meta name=keywords content=microservices,services,mesh><meta property=og:title content="Distributed Tracing FAQ"><meta property=og:type content=website><meta property=og:description content="Distributed Tracing Q &amp; A."><meta property=og:url content=/v1.4/faq/distributed-tracing/><meta property=og:image content=/v1.4/img/istio-whitelogo-bluebackground-framed.svg><meta property=og:image:alt content="Istio Logo"><meta property=og:image:width content=112><meta property=og:image:height content=150><meta property=og:site_name content=Istio><meta name=twitter:card content=summary><meta name=twitter:site content=@IstioMesh><title>Istioldie 1.4 / Distributed Tracing FAQ</title><script async src="https://www.googletagmanager.com/gtag/js?id=UA-98480406-2"></script><script>window.dataLayer=window.dataLayer||[];function gtag(){dataLayer.push(arguments);}
gtag('js',new Date());gtag('config','UA-98480406-2');</script><link rel=alternate type=application/rss+xml title="Istio Blog" href=/v1.4/blog/feed.xml><link rel=alternate type=application/rss+xml title="Istio News" href=/v1.4/news/feed.xml><link rel=alternate type=application/rss+xml title="Istio Blog and News" href=/v1.4/feed.xml><link rel="shortcut icon" href=/v1.4/favicons/favicon.ico><link rel=apple-touch-icon href=/v1.4/favicons/apple-touch-icon-180x180.png sizes=180x180><link rel=icon type=image/png href=/v1.4/favicons/favicon-16x16.png sizes=16x16><link rel=icon type=image/png href=/v1.4/favicons/favicon-32x32.png sizes=32x32><link rel=icon type=image/png href=/v1.4/favicons/android-36x36.png sizes=36x36><link rel=icon type=image/png href=/v1.4/favicons/android-48x48.png sizes=48x48><link rel=icon type=image/png href=/v1.4/favicons/android-72x72.png sizes=72x72><link rel=icon type=image/png href=/v1.4/favicons/android-96x96.png sizes=96xW96><link rel=icon type=image/png href=/v1.4/favicons/android-144x144.png sizes=144x144><link rel=icon type=image/png href=/v1.4/favicons/android-192x192.png sizes=192x192><link rel=manifest href=/v1.4/manifest.json><meta name=apple-mobile-web-app-title content=Istio><meta name=application-name content=Istio><link rel=stylesheet href="https://fonts.googleapis.com/css?family=Work+Sans:400|Chivo:400|Work+Sans:500,300,600,300italic,400italic,500italic,600italic|Chivo:500,300,600,300italic,400italic,500italic,600italic"><link rel=stylesheet href=/v1.4/css/all.css><script src=/v1.4/js/themes_init.min.js></script></head><body class="language-unknown archive-site"><script>const branchName="release-1.4";const docTitle="Distributed Tracing FAQ";const iconFile="\/v1.4/img/icons.svg";const buttonCopy='Copy to clipboard';const buttonPrint='Print';const buttonDownload='Download';</script><script src="https://www.google.com/cse/brand?form=search-form" defer></script><script src=/v1.4/js/all.min.js data-manual defer></script><header><nav><a id=brand href=/v1.4/><span class=logo><svg viewBox="0 0 300 300"><circle cx="150" cy="150" r="146" stroke-width="2"/><path d="M65 240H225L125 270z"/><path d="M65 230l60-10V110z"/><path d="M135 220l90 10L135 30z"/></svg></span><span class=name>Istioldie 1.4</span></a><div id=hamburger><svg class="icon"><use xlink:href="/v1.4/img/icons.svg#hamburger"/></svg></div><div id=header-links><a title="Learn how to deploy, use, and operate Istio." href=/v1.4/docs/>Docs</a>
<a title="Posts about using Istio." href=/v1.4/blog/2020/>Blog<i class=dot data-prefix=/blog></i></a>
<a title="Timely news about the Istio project." href=/v1.4/news/>News<i class=dot data-prefix=/news></i></a>
<a class=current title="Frequently Asked Questions about Istio." href=/v1.4/faq/>FAQ</a>
<a title="Get a bit more in-depth info about the Istio project." href=/v1.4/about/>About</a><div class=menu><button id=gearDropdownButton class=menu-trigger title="Options and settings" aria-label="Options and Settings" aria-controls=gearDropdownContent><svg class="icon"><use xlink:href="/v1.4/img/icons.svg#gear"/></svg></button><div id=gearDropdownContent class=menu-content aria-labelledby=gearDropdownButton role=menu><a tabindex=-1 role=menuitem class=active id=light-theme-item>Light Theme</a>
<a tabindex=-1 role=menuitem id=dark-theme-item>Dark Theme</a><div role=separator></div><a tabindex=-1 role=menuitem id=syntax-coloring-item>Color Examples</a><div role=separator></div><h6>Other versions of this site</h6><a tabindex=-1 role=menuitem onclick="navigateToUrlOrRoot('https://istio.io/faq\/distributed-tracing\/');return false;">Current Release</a>
<a tabindex=-1 role=menuitem onclick="navigateToUrlOrRoot('https://preliminary.istio.io/faq\/distributed-tracing\/');return false;">Next Release</a>
<a tabindex=-1 role=menuitem href=https://istio.io/archive>Older Releases</a></div></div><button id=search-show title="Search this site" aria-label=Search><svg class="icon"><use xlink:href="/v1.4/img/icons.svg#magnifier"/></svg></button></div><form id=search-form name=cse role=search><input type=hidden name=cx value=013699703217164175118:iwwf17ikgf4>
<input type=hidden name=ie value=utf-8>
<input type=hidden name=hl value=en>
<input type=hidden id=search-page-url value=/v1.4/search>
<input id=search-textbox class=form-control name=q type=search aria-label="Search this site">
<button id=search-close title="Cancel search" type=reset aria-label="Cancel search"><svg class="icon"><use xlink:href="/v1.4/img/icons.svg#cancel-x"/></svg></button></form></nav></header><div class=banner-container></div><main class="primary notoc"><div id=sidebar-container class="sidebar-container sidebar-offcanvas"><nav id=sidebar aria-label="Section Navigation"><div class=directory><div class=card><div id=header0 class=header title="Frequently Asked Questions about Istio."><svg class="icon"><use xlink:href="/v1.4/img/icons.svg#faq"/></svg>FAQ</div><div class="body default" aria-labelledby=header0><ul role=tree aria-expanded=true class=leaf-section aria-labelledby=header0><li role=none><a role=treeitem title="General Q &amp; A." href=/v1.4/faq/general/>General</a></li><li role=none><a role=treeitem title="Setup Q &amp; A." href=/v1.4/faq/setup/>Setup</a></li><li role=none><a role=treeitem title="Application Specific Q &amp; A." href=/v1.4/faq/applications/>Applications</a></li><li role=none><a role=treeitem title="Security Q &amp; A." href=/v1.4/faq/security/>Security</a></li><li role=none><a role=treeitem title="Mixer Q &amp; A." href=/v1.4/faq/mixer/>Mixer</a></li><li role=none><a role=treeitem title="Metrics and Logs Q &amp; A." href=/v1.4/faq/metrics-and-logs/>Metrics and Logs</a></li><li role=none><span role=treeitem class=current title="Distributed Tracing Q &amp; A.">Distributed Tracing</span></li><li role=none><a role=treeitem title="Traffic Management Q &amp; A." href=/v1.4/faq/traffic-management/>Traffic Management</a></li></ul></div></div></div></nav></div><div class=article-container><nav aria-label=Breadcrumb><ol><li><a href=/v1.4/ title="Connect, secure, control, and observe services.">Istio</a></li><li><a href=/v1.4/faq/ title="Frequently Asked Questions about Istio.">FAQ</a></li><li>Distributed Tracing</li></ol></nav><article aria-labelledby=title><div class=title-area><i class=title-icon><svg class="icon"><use xlink:href="/v1.4/img/icons.svg#faq"/></svg></i><div style=width:100%><h1 id=title>Distributed Tracing FAQ</h1></div></div><nav class="toc-inlined toc-forced"><hr><div class=directory role=directory><nav id=InlineTableOfContents><ol><li role=none aria-label="How does distributed tracing work with Istio?"><a href=#how-distributed-tracing-works>How does distributed tracing work with Istio?</a></li><li role=none aria-label="What is required for distributed tracing with Istio?"><a href=#how-to-support-tracing>What is required for distributed tracing with Istio?</a></li><li role=none aria-label="How does Envoy-based tracing work?"><a href=#how-envoy-based-tracing-works>How does Envoy-based tracing work?</a></li><li role=none aria-label="How does Mixer-based tracing work?"><a href=#how-mixer-based-tracing-works>How does Mixer-based tracing work?</a></li><li role=none aria-label="What is the minimal Istio configuration required for distributed tracing?"><a href=#minimal-requirements>What is the minimal Istio configuration required for distributed tracing?</a></li><li role=none aria-label="What generates the initial Zipkin (B3) HTTP headers?"><a href=#initial-zipkin-header>What generates the initial Zipkin (B3) HTTP headers?</a></li><li role=none aria-label="Why can't Istio propagate headers instead of the application?"><a href=#istio-copy-headers>Why can&#39;t Istio propagate headers instead of the application?</a></li><li role=none aria-label="Why are my requests not being traced?"><a href=#no-tracing>Why are my requests not being traced?</a></li><li role=none aria-label="How can I control the volume of traces?"><a href=#control-sampling>How can I control the volume of traces?</a></li><li role=none aria-label="How do I disable tracing?"><a href=#disabling-tracing>How do I disable tracing?</a></li><li role=none aria-label="Can Istio send tracing information to an external Zipkin-compatible backend?"><a href=#external-zipkin>Can Istio send tracing information to an external Zipkin-compatible backend?</a></li><li role=none aria-label="Does Istio support request tracing for vert.x event bus messages?"><a href=#vert.x>Does Istio support request tracing for vert.x event bus messages?</a></li><li role=none aria-label="What role does Mixer play in the Istio tracing story?"><a href=#mixer-role>What role does Mixer play in the Istio tracing story?</a></li><li role=none aria-label="Why do I see `istio-mixer` spans in some of my distributed traces?"><a href=#why-mixer-spans>Why do I see `istio-mixer` spans in some of my distributed traces?</a></li></ol></nav></div><hr></nav><div class=faq><h5 id=how-distributed-tracing-works class=question>How does distributed tracing work with Istio?</h5><div class=answer><p>Istio integrates with distributed tracing systems in two different ways: <a href=#how-envoy-based-tracing-works>Envoy-based</a> and <a href=#how-mixer-based-tracing-works>Mixer-based</a> tracing integrations. For both tracing integration approaches, <a href=#istio-copy-headers>applications are responsible for forwarding tracing headers</a> for subsequent outgoing requests.</p><p>You can find additional information in the Istio Distributed Tracing (<a href=/v1.4/docs/tasks/observability/distributed-tracing/jaeger/>Jaeger</a>, <a href=/v1.4/docs/tasks/observability/distributed-tracing/lightstep/>LightStep</a>, <a href=/v1.4/docs/tasks/observability/distributed-tracing/zipkin/>Zipkin</a>) Tasks and
in the <a href=https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/observability/tracing>Envoy tracing docs</a>.</p></div><h5 id=how-to-support-tracing class=question>What is required for distributed tracing with Istio?</h5><div class=answer><p>Istio enables reporting of trace spans for workload-to-workload communications within a mesh. However, in order for various trace spans to be stitched together for a complete view of the traffic flow, applications must propagate the trace context between incoming and outgoing requests.</p><p>In particular, Istio relies on applications to <a href=https://github.com/openzipkin/b3-propagation>propagate the B3 trace headers</a>, as well as the Envoy-generated request ID. These headers include:</p><ul><li><code>x-request-id</code></li><li><code>x-b3-traceid</code></li><li><code>x-b3-spanId</code></li><li><code>x-b3-parentspanid</code></li><li><code>x-b3-sampled</code></li><li><code>x-b3-flags</code></li><li><code>b3</code></li></ul><p>If you are using LightStep, you will also need to forward the following headers:</p><ul><li><code>x-ot-span-context</code></li></ul><p>Header propagation may be accomplished through client libraries, such as <a href=https://zipkin.io/pages/tracers_instrumentation.html>Zipkin</a> or <a href=https://github.com/jaegertracing/jaeger-client-java/tree/master/jaeger-core#b3-propagation>Jaeger</a>. It may also be accomplished manually, as documented in the <a href=/v1.4/docs/tasks/observability/distributed-tracing/overview#trace-context-propagation>Distributed Tracing Task</a>.</p></div><h5 id=how-envoy-based-tracing-works class=question>How does Envoy-based tracing work?</h5><div class=answer><p>For Envoy-based tracing integrations, Envoy (the sidecar proxy) sends tracing information directly to tracing backends on behalf of the applications being proxied.</p><p>Envoy:</p><ul><li>generates request IDs and trace headers (i.e. <code>X-B3-TraceId</code>) for requests as they flow through the proxy</li><li>generates trace spans for each request based on request and response metadata (i.e. response time)</li><li>sends the generated trace spans to the tracing backends</li><li>forwards the trace headers to the proxied application</li></ul><p>Istio supports the Envoy-based integrations of <a href=/v1.4/docs/tasks/observability/distributed-tracing/lightstep/>LightStep</a> and <a href=/v1.4/docs/tasks/observability/distributed-tracing/zipkin/>Zipkin</a>, as well as all Zipkin API-compatible backends, including <a href=/v1.4/docs/tasks/observability/distributed-tracing/jaeger/>Jaeger</a>.</p></div><h5 id=how-mixer-based-tracing-works class=question>How does Mixer-based tracing work?</h5><div class=answer><p>For Mixer-based tracing integrations, Mixer (addressed through the <code>istio-telemetry</code> service) provides the integration with tracing backends. The Mixer integration allows additional levels of operator control of the distributed tracing, including fine-grained selection of the data included in trace spans. It also provides the ability to send traces to backends not supported by Envoy directly.</p><p>For Mixer-based integrations, Envoy:</p><ul><li>generates request IDs and trace headers (i.e. <code>X-B3-TraceId</code>) for requests as they flow through the proxy</li><li>calls Mixer for general asynchronous telemetry reporting</li><li>forwards the trace headers to the proxied application</li></ul><p>Mixer:</p><ul><li>generates trace spans for each request based on <em>operator-supplied</em> configuration</li><li>sends the generated trace spans to the <em>operator-designated</em> tracing backends</li></ul><p>The <a href=https://cloud.google.com/istio/docs/istio-on-gke/installing#tracing_and_logging>Stackdriver tracing integration</a> with Istio is one example of a tracing integration via Mixer.</p></div><h5 id=minimal-requirements class=question>What is the minimal Istio configuration required for distributed tracing?</h5><div class=answer><p>The <a href=/v1.4/docs/setup/install/helm/>Istio minimal profile</a> with tracing enabled is all that is required for Istio to integrate with Zipkin-compatible backends.</p></div><h5 id=initial-zipkin-header class=question>What generates the initial Zipkin (B3) HTTP headers?</h5><div class=answer><p>The Istio sidecar proxy (Envoy) generates the initial <a href=https://www.envoyproxy.io/docs/envoy/latest/configuration/http/http_conn_man/headers#x-request-id>headers</a>, if they are not provided by the request.</p></div><h5 id=istio-copy-headers class=question>Why can&#39;t Istio propagate headers instead of the application?</h5><div class=answer><p>Although an Istio sidecar will process both inbound and outbound requests for an associated application instance, it has no implicit way of correlating
the outbound requests to the inbound request that caused them. The only way this correlation can be achieved is if the application
propagates relevant information (i.e. headers) from the inbound request to the outbound requests. Header propagation may be accomplished through client
libraries or manually. Further discussion is provided in <a href=/v1.4/faq/distributed-tracing/#how-to-support-tracing>What is required for distributed tracing with Istio?</a>.</p></div><h5 id=no-tracing class=question>Why are my requests not being traced?</h5><div class=answer><p>Since Istio 1.0.3, the sampling rate for tracing has been reduced to 1% in the <code>default</code>
<a href=/v1.4/docs/setup/additional-setup/config-profiles/>configuration profile</a>.
This means that only 1 out of 100 trace instances captured by Istio will be reported to the tracing backend.
The sampling rate in the <code>demo</code> profile is still set to 100%. See
<a href=/v1.4/docs/tasks/observability/distributed-tracing/overview/#trace-sampling>this section</a>
for more information on how to set the sampling rate.</p><p>If you still do not see any trace data, please confirm that your ports conform to the Istio <a href=/v1.4/faq/traffic-management/#naming-port-convention>port naming conventions</a> and that the appropriate container port is exposed (via pod spec, for example) to enable
traffic capture by the sidecar proxy (Envoy).</p><p>If you only see trace data associated with the egress proxy, but not the ingress proxy, it may still be related to the Istio <a href=/v1.4/faq/traffic-management/#naming-port-convention>port naming conventions</a>. Starting with <a href=/v1.4/news/releases/1.3.x/announcing-1.3/#intelligent-protocol-detection-experimental>Istio 1.3</a> the protocol for <strong>outbound</strong> traffic is automatically detected.</p></div><h5 id=control-sampling class=question>How can I control the volume of traces?</h5><div class=answer><p>Istio, via Envoy, currently supports a percentage-based sampling strategy for trace generation.
Please see <a href=/v1.4/docs/tasks/observability/distributed-tracing/overview/#trace-sampling>this section</a> for more information on how to set this sampling rate.</p></div><h5 id=disabling-tracing class=question>How do I disable tracing?</h5><div class=answer><p>If you already have installed Istio with tracing enabled, you can disable it as follows:</p><pre><code class=language-plain data-expandlinks=true data-repo=istio># Fill &lt;istio namespace&gt; with the namespace of your istio mesh.Ex: istio-system
TRACING_POD=`kubectl get po -n &lt;istio namespace&gt; | grep istio-tracing | awk &#39;{print $1}&#39;`
$ kubectl delete pod $TRACING_POD -n &lt;istio namespace&gt;
$ kubectl delete services tracing zipkin -n &lt;istio namespace&gt;
# Remove reference of zipkin url from mixer deployment
$ kubectl -n istio-system edit deployment istio-telemetry
# Now, manually remove instances of trace_zipkin_url from the file and save it.
</code></pre><p>Then follow the steps of the <a href=/v1.4/docs/tasks/observability/distributed-tracing/zipkin/#cleanup>cleanup section of the Distributed Tracing task</a>.</p><p>If you dont want tracing functionality at all, then <a href=/v1.4/docs/tasks/observability/distributed-tracing/zipkin/#before-you-begin>disable tracing</a> when installing Istio.</p></div><h5 id=external-zipkin class=question>Can Istio send tracing information to an external Zipkin-compatible backend?</h5><div class=answer><p>To do so, you must you use the fully qualified domain name of the Zipkin-compatible instance. For example:
<code>zipkin.mynamespace.svc.cluster.local</code>.</p></div><h5 id=vert.x class=question>Does Istio support request tracing for vert.x event bus messages?</h5><div class=answer><p>Istio does not currently provide support for pub/sub and event bus protocols. Any use of those technologies is best-effort and subject to breakage.</p></div><h5 id=mixer-role class=question>What role does Mixer play in the Istio tracing story?</h5><div class=answer><p>By default, Mixer participates in tracing by generating its own spans for requests that are already selected for tracing by Envoy proxies. This enables operators to observe the participation of the mixer-based policy enforcement mechanisms within the mesh. If the <code>istio-policy</code> configuration is disabled mesh-wide, Mixer does not participate in tracing in this way.</p><p>Mixer, operating as the <code>istio-telemetry</code> service, can also be used to generate trace spans for data plane traffic. Mixers Stackdriver adapter is an example of an adapter that supports this capability.</p><p>For Mixer-generated traces, Istio still relies on Envoy to generate trace context and to forward it to the applications that must propagate the context. Instead of Envoy itself sending trace information directly to a tracing backend, Mixer distills client and server spans from the regular Envoy reporting for each request based on operator-supplied configuration. In this way, operators can precisely control when and how trace data is generated and perhaps remove certain services entirely from a trace or provide more detailed information for certain namespaces.</p></div><h5 id=why-mixer-spans class=question>Why do I see `istio-mixer` spans in some of my distributed traces?</h5><div class=answer><p>Mixer generates application-level traces for requests that reach Mixer with tracing headers. Mixer generates spans, labeled <code>istio-mixer</code> for any critical work that it does, including dispatch to individual adapters.</p><p>Envoy caches calls to Mixer on the data path. As a result, calls out to Mixer made via the <code>istio-policy</code> service only happen for certain requests, for example: cache-expiry or different request characteristics. For this reason, you only see Mixer participate in <em>some</em> of your traces.</p><p>To turn off the application-level trace spans for Mixer itself, you must edit the deployment configuration for <code>istio-policy</code> and remove the <code>--trace_zipkin_url</code> command-line parameter.</p></div></div></article><nav class=pagenav><div class=left><a title="Metrics and Logs Q &amp; A." href=/v1.4/faq/metrics-and-logs/><svg class="icon"><use xlink:href="/v1.4/img/icons.svg#left-arrow"/></svg>Metrics and Logs</a></div><div class=right><a title="Traffic Management Q &amp; A." href=/v1.4/faq/traffic-management/>Traffic Management<svg class="icon"><use xlink:href="/v1.4/img/icons.svg#right-arrow"/></svg></a></div></nav><div id=endnotes-container aria-hidden=true><h2>Links</h2><ol id=endnotes></ol></div></div></main><footer><div class=user-links><a class=channel title="Go download Istio 1.4.6 now" href=/v1.4/docs/setup/getting-started/#download aria-label="Download Istio"><span>download</span><svg class="icon"><use xlink:href="/v1.4/img/icons.svg#download"/></svg>
</a><a class=channel title="Join the Istio discussion board to participate in discussions and get help troubleshooting problems" href=https://discuss.istio.io aria-label="Istio discussion board"><span>discuss</span><svg class="icon"><use xlink:href="/v1.4/img/icons.svg#discourse"/></svg></a>
<a class=channel title="Stack Overflow is where you can ask questions and find curated answers on deploying, configuring, and using Istio" href=https://stackoverflow.com/questions/tagged/istio aria-label="Stack Overflow"><span>stack overflow</span><svg class="icon"><use xlink:href="/v1.4/img/icons.svg#stackoverflow"/></svg></a>
<a class=channel title="Interactively discuss issues with the Istio community on Slack" href=https://istio.slack.com aria-label=slack><span>slack</span><svg class="icon"><use xlink:href="/v1.4/img/icons.svg#slack"/></svg></a>
<a class=channel title="Follow us on Twitter to get the latest news" href=https://twitter.com/IstioMesh aria-label=Twitter><span>twitter</span><svg class="icon"><use xlink:href="/v1.4/img/icons.svg#twitter"/></svg></a><div class=tag>for everyone</div></div><div class=info><p class=copyright>Istio Archive
1.4.6<br>&copy; 2019 Istio Authors, <a href=https://policies.google.com/privacy>Privacy Policy</a><br>Archived on March 5, 2020</p></div><div class=dev-links><a class=channel title="GitHub is where development takes place on Istio code" href=https://github.com/istio/community aria-label=GitHub><span>github</span><svg class="icon"><use xlink:href="/v1.4/img/icons.svg#github"/></svg></a>
<a class=channel title="Access our team drive if you'd like to take a look at the Istio technical design documents" href=https://groups.google.com/forum/#!forum/istio-team-drive-access aria-label="team drive"><span>drive</span><svg class="icon"><use xlink:href="/v1.4/img/icons.svg#drive"/></svg></a>
<a class=channel title="If you'd like to contribute to the Istio project, consider participating in our working groups" href=https://github.com/istio/community/blob/master/WORKING-GROUPS.md aria-label="working groups"><span>working groups</span><svg class="icon"><use xlink:href="/v1.4/img/icons.svg#working-groups"/></svg></a><div class=tag>for developers</div></div></footer><div id=scroll-to-top-container aria-hidden=true><button id=scroll-to-top title="Back to top"><svg class="icon"><use xlink:href="/v1.4/img/icons.svg#top"/></svg></button></div></body></html>