Overview

    Istio leverages Envoy’s distributed tracing feature to provide tracing integration out of the box. Specifically, Istio provides options to install various tracing backends and configure proxies to send trace spans to them automatically. See , Jaeger, , and OpenCensus Agent task docs about how Istio works with those tracing systems.

    Although Istio proxies can automatically send spans, extra information is needed to join those spans into a single trace. Applications must propagate this information in HTTP headers, so that when proxies send spans, the backend can join them together into a single trace.

    To do this, each application must collect headers from each incoming request and forward the headers to all outgoing requests triggered by that incoming request. The choice of headers to forward depends on the configured trace backend. The set of headers to forward are described in each trace backend-specific task page. The following is a summary:

    • : this is an envoy-specific header that is used to consistently sample logs and traces.

    For Zipkin, Jaeger, Stackdriver, and OpenCensus Agent the B3 multi-header format should be forwarded:

    • x-b3-traceid
    • x-b3-spanid
    • x-b3-parentspanid
    • x-b3-sampled

    For Datadog, the following headers should be forwarded. Forwarding these is handled automatically by Datadog client libraries for many languages and frameworks.

    • x-datadog-trace-id.
    • .
    • x-datadog-sampling-priority.

    For Lightstep, the OpenTracing span context header should be forwarded:

    • x-ot-span-context
    • grpc-trace-bin: Standard grpc trace header.
    • traceparent: W3C Trace Context standard for tracing. Supported by all OpenCensus, OpenTelemetry, and an increasing number of Jaeger client libraries.

    If you look at the sample Python productpage service, for example, you see that the application extracts the required headers for all tracers from an HTTP request using OpenTracing libraries:

    The reviews application (Java) does something similar using :

    int productId,)

    1. @GET
    2. @Path("/reviews/{productId}")
    3. public Response bookReviewsById(@PathParam("productId") int productId, @Context HttpHeaders requestHeaders) {
    4. // ...
    5. JsonObject ratingsResponse = getRatings(Integer.toString(productId), requestHeaders);