Tracing

    • Request ID generation: Envoy will generate UUIDs when needed and populate the HTTP header. Applications can forward the x-request-id header for unified logging as well as tracing.
    • External trace service integration: Envoy supports pluggable external trace visualization providers. Currently Envoy supports LightStep, or any Zipkin compatible backends (e.g. Jaeger). However, support for other tracing providers would not be difficult to add.

    The HTTP connection manager that handles the request must have the object set. There are several ways tracing can be initiated:

    The router filter is also capable of creating a child span for egress calls via the option.

    Whichever tracing provider is being used, the service should propagate the x-request-id to enable logging across the invoked services to be correlated.

    The tracing providers also require additional context, to enable the parent/child relationships between the spans (logical units of work) to be understood. This can be achieved by using the LightStep (via OpenTracing API) or Zipkin tracer directly within the service itself, to extract the trace context from the inbound request and inject it into any subsequent outbound requests. This approach would also enable the service to create additional spans, describing work being done internally within the service, that may be useful when examining the end-to-end trace.

    • When using the LightStep tracer, Envoy relies on the service to propagate the HTTP header while sending HTTP requests to other services.
    • When using the Zipkin tracer, Envoy relies on the service to propagate the B3 HTTP headers ( x-b3-traceid, , x-b3-parentspanid, , and x-b3-flags). The header can also be supplied by an external client to either enable or disable tracing for a particular request.

    An end-to-end trace is comprised of one or more spans. A span represents a logical unit of work that has a start time and duration and can contain metadata associated with it. Each span generated by Envoy contains the following data:

    • Originating service cluster set via .
    • Originating host set via .
    • Downstream cluster set via the x-envoy-downstream-service-cluster header.
    • HTTP URL.
    • HTTP method.
    • HTTP response code.
    • Tracing system-specific metadata.

    The span also includes a name (or operation) which by default is defined as the host of the invoked service. However this can be customized using a on the route. The name can also be overridden using the x-envoy-decorator-operation header.

    for more information on how to setup tracing in Envoy.