Skip to content
This repository has been archived by the owner on Nov 30, 2021. It is now read-only.

Commit

Permalink
change span name from method to path
Browse files Browse the repository at this point in the history
  • Loading branch information
劉心惟 authored and 劉心惟 committed Sep 6, 2021
1 parent 3564dbd commit a80a68a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions kong/plugins/zipkin/handler.lua
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ if subsystem == "http" then
local header_type, trace_id, span_id, parent_id, should_sample, baggage =
tracing_headers.parse(req_headers)
local method = req.get_method()
local path = req.get_path()

if should_sample == nil then
should_sample = math_random() < conf.sample_ratio
Expand All @@ -127,7 +128,7 @@ if subsystem == "http" then

local request_span = new_span(
"SERVER",
method,
method .. ' ' .. path,
ngx_req_start_time_mu(),
should_sample,
trace_id,
Expand All @@ -140,7 +141,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
Expand Down

0 comments on commit a80a68a

Please sign in to comment.