Envoy: Add a configuration option to always generate unique ids for Zipkin trace spans

Created on 11 Sep 2018  路  2Comments  路  Source: envoyproxy/envoy

Description:

The goal is to add a configuration option to always generate unique ids for Zipkin trace spans, and prevent using the parent span id as the child span id.

Related Links:


Context:

Given that I have the following setup:

  • A kubernetes cluster that has istio 0.8.0 with envoy sidecar injection enabled
  • A service myservice deployed on that cluster
  • An nginx-ingress-controller to access myservice

After sending requests from nginx to myservice, the generated trace spans are:

nginx (SpanID: 8640f64baf1a6a14) [parent span]
|
|---> nginx (SpanID: 3c2f583711047c5d) [child span 1]
|
|---> myservice (SpanID: 3c2f583711047c5d) [child span 2]

The issue is, the same SpanID 3c2f583711047c5d is used for both of the child spans nginx and myservice, which causing inconsistency in the tracing flow.

Incoming headers from nginx:

Accept: [*/*]
Content-Length: [153]
User-Agent: [curl/7.52.1]
Content-Type: [application/json]
Ssl-Client-Verify: [SUCCESS]
Ssl-Client-Issuer-Dn: [somevalues]
Ssl-Client-Subject-Dn: [somevalues]
X-B3-Flags: [0]
X-Scheme: [https]
X-B3-Sampled: [1]
X-Real-Ip: [someip]
X-Forwarded-Port: [443]
X-Envoy-Internal: [true]
X-Forwarded-For: [someip]
X-Original-Uri: [someuri]
X-Forwarded-Proto: [https]
X-B3-Spanid: [3c2f583711047c5d]
X-B3-Traceid: [751c7b5d680bc470]
X-B3-Parentspanid: [8640f64baf1a6a14]
X-Forwarded-Host: [somehost:someport]
X-Envoy-Expected-Rq-Timeout-Ms: [15000]
X-Request-Id: [2807a195f768fc7469ee1f68a946411f]

Desired behaviour:

I would expect that nginx span would be the parent of myservice span, and there is a new SpanID generated for myservice span. It should be something like this:

nginx (SpanID: 8640f64baf1a6a14) [parent span]
|
|---> nginx (SpanID: 3c2f583711047c5d) [child span 1]
      |
      |---> myservice (SpanID: new-span-id) [child span 2]
enhancement

Most helpful comment

1.8.0 will be tagged in the next 1-2 weeks.

All 2 comments

@mattklein123 Would it be possible to know in which envoy version will this be available?

1.8.0 will be tagged in the next 1-2 weeks.

Was this page helpful?
0 / 5 - 0 ratings