Skip to content

Tracing headers not propagated when x-ot-span-context header is omitted #1364

@chrisleavoy

Description

@chrisleavoy

Within Zipkin, there isn't a concept of an 'x-ot-span-context' header. However, the initial version of the Zipkin support within Envoy requires this header to be present for Envoy to propagate the B3 headers downstream. The following is an example of a service making an inter-service call through Envoy.

Current behavior:

T 172.17.0.1:37180 -> 172.17.0.3:80 [AP]
GET / HTTP/1.1.
Host: obfuscated:8080.
x-b3-traceid: df2a47707d36857e.
x-b3-spanid: 1fcdac653464b039.
x-b3-parentspanid: de13127f091b8510.
x-b3-sampled: 1.
.

T 172.17.0.3:38092 -> 172.17.0.1:80 [AP]
GET / HTTP/1.1.
host: obfuscated:8080.
x-b3-traceid: 0000943861e352ca.
x-b3-spanid: 0000943861e352ca.
x-b3-parentspanid: de13127f091b8510.
x-b3-sampled: 1.
x-forwarded-proto: http.
x-request-id: f30826a5-e41a-99f4-a9ac-6daef36f4dd3.
x-ot-span-context: 0000943861e352ca;0000943861e352ca;0000000000000000;cs.

Notice in the current behavior that the x-b3-traceid does not match the existing trace identifier. It is dropped, and essentially a new trace is created. Also note, the parentspanid has an erroneous value. If Envoy decided to initiate a new and independent trace, the parent should be absent or null, and not use the parent of an unrelated trace.

Expected behavior:

T 172.17.0.3:38092 -> 172.17.0.1:80 [AP]
GET / HTTP/1.1.
host: obfuscated:8080.
x-b3-traceid: df2a47707d36857e.
x-b3-spanid: 0000943861e352ca.
x-b3-parentspanid: 1fcdac653464b039.
x-b3-sampled: 1.
x-forwarded-proto: http.
x-request-id: f30826a5-e41a-99f4-a9ac-6daef36f4dd3.

Notice in the expected behavior, x-b3-traceid remains the same as the initial request. parentspanid becomes the spanid from the upstream request, and spanid is a newly generated identifier.

Without Envoy, Trace T has one root span called X, Service A calls Service B. Service A annotates span X with CS CR. Optional: Service B annotates span X with SR SS.

When using Envoy, Trace T has one root span Y, and one child span Y. Service A calls Service B via Envoy. Service A annotates span X with CS CR. Envoy annotates span X with SR SS. Envoy injects span Y and annotates with CS CR. Optional: Service B annotates span Y with SR SS.

@mattklein123 @fabolive @rshriram @adriancole

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions