Skip to content
This repository was archived by the owner on Sep 7, 2021. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions kong/plugins/zipkin/handler.lua
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,13 @@ if subsystem == "http" then
initialize_request = function(conf, ctx)
local req = kong.request

local header_type, trace_id, span_id, parent_id, should_sample, baggage =
tracing_headers.parse(req.get_headers())
local header_type = conf.default_header_type
local trace_id, span_id, parent_id, should_sample, baggage
if conf.header_type ~= "ignore" then
header_type, trace_id, span_id, parent_id, should_sample, baggage =
tracing_headers.parse(req.get_headers())
end

local method = req.get_method()

if should_sample == nil then
Expand Down
2 changes: 1 addition & 1 deletion kong/plugins/zipkin/schema.lua
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ return {
{ include_credential = { type = "boolean", required = true, default = true } },
{ traceid_byte_count = { type = "integer", required = true, default = 16, one_of = { 8, 16 } } },
{ header_type = { type = "string", required = true, default = "preserve",
one_of = { "preserve", "b3", "b3-single", "w3c", "jaeger" } } },
one_of = { "preserve", "ignore", "b3", "b3-single", "w3c", "jaeger" } } },
{ default_header_type = { type = "string", required = true, default = "b3",
one_of = { "b3", "b3-single", "w3c", "jaeger" } } },
{ static_tags = { type = "array", elements = static_tag,
Expand Down
1 change: 1 addition & 0 deletions kong/plugins/zipkin/tracing_headers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ local function set(conf_header_type, found_header_type, proxy_span, conf_default

if conf_header_type ~= "preserve" and
found_header_type ~= nil and
conf_header_type ~= "ignore" and
conf_header_type ~= found_header_type
then
kong.log.warn("Mismatched header types. conf: " .. conf_header_type .. ". found: " .. found_header_type)
Expand Down