diff --git a/kong/plugins/zipkin/handler.lua b/kong/plugins/zipkin/handler.lua index fe15156..4786386 100644 --- a/kong/plugins/zipkin/handler.lua +++ b/kong/plugins/zipkin/handler.lua @@ -124,10 +124,16 @@ if subsystem == "http" then if trace_id == nil then trace_id = rand_bytes(conf.traceid_byte_count) end + + local span_format = method + local path = req.get_path() + if conf.span_display_path == true then + span_format = method .. ' ' .. path + end local request_span = new_span( "SERVER", - method, + span_format, ngx_req_start_time_mu(), should_sample, trace_id, @@ -140,7 +146,7 @@ if subsystem == "http" then request_span:set_tag("lc", "kong") request_span:set_tag("http.method", method) - request_span:set_tag("http.path", req.get_path()) + request_span:set_tag("http.path", path) local static_tags = conf.static_tags if type(static_tags) == "table" then diff --git a/kong/plugins/zipkin/schema.lua b/kong/plugins/zipkin/schema.lua index 5f91a9b..1171765 100644 --- a/kong/plugins/zipkin/schema.lua +++ b/kong/plugins/zipkin/schema.lua @@ -60,6 +60,7 @@ return { { tags_header = { type = "string", required = true, default = "Zipkin-Tags" } }, { static_tags = { type = "array", elements = static_tag, custom_validator = validate_static_tags } }, + { span_display_path = { type = "boolean", default = false } }, }, }, }, },