Kong/kong-plugin-zipkin

Honor x-b3 request headers

Opened this issue · 1 comments

The plugin will remove existing x-B3 headers if they exist on the incoming request: https://github.com/Kong/kong-plugin-zipkin/blob/master/kong/plugins/zipkin/codec.lua#L88-L93

Users might want end to end traceability from the browser to the API. Therefore we would like to allow existing headers to be honored and any that are not present to be created by the plugin.

Maybe any x-b3 hearers that are included will be overwritten or removed unless the parentspanid header is present?

The traceId gets respected and passed on. The other header fields are span Id and parent span Id, which should really be set by Kong and not a third party (since Kong is the one creating the spans).

If someone is experiencing issues where a trace id is not being passed on, it is likely to happen somewhere else. For instance, in a network where Kong is used as a middleman between nodes, like so:

client --> Kong ---> A ---> Kong ---> B

It's possible that Service A is the one mangling the headers. The Kong node between A and B would add a new trace Id, and the two traces would appear unrelated.