@@ -164,6 +164,7 @@ describe("http integration tests with zipkin server [#"
164164 { name = " static" , value = " ok" },
165165 },
166166 default_header_type = " b3-single" ,
167+ include_header_x_request_id = true ,
167168 }
168169 })
169170
@@ -221,12 +222,15 @@ describe("http integration tests with zipkin server [#"
221222
222223 it (" generates spans, tags and annotations for regular requests" , function ()
223224 local start_s = ngx .now ()
225+ local uuid = require (" resty.jit-uuid" )
226+ local x_request_id = uuid .generate_v4 ()
224227
225228 local r = proxy_client :get (" /" , {
226229 headers = {
227230 [" x-b3-sampled" ] = " 1" ,
228231 host = " http-route" ,
229- [" zipkin-tags" ] = " foo=bar; baz=qux"
232+ [" zipkin-tags" ] = " foo=bar; baz=qux" ,
233+ [" x-request-id" ] = x_request_id
230234 },
231235 })
232236 assert .response (r ).has .status (200 )
@@ -244,6 +248,7 @@ describe("http integration tests with zipkin server [#"
244248 [" http.method" ] = " GET" ,
245249 [" http.path" ] = " /" ,
246250 [" http.status_code" ] = " 200" , -- found (matches server status)
251+ [" guid:x-request-id" ] = x_request_id ,
247252 lc = " kong" ,
248253 static = " ok" ,
249254 foo = " bar" ,
@@ -292,6 +297,8 @@ describe("http integration tests with zipkin server [#"
292297
293298 it (" generates spans, tags and annotations for regular requests (#grpc)" , function ()
294299 local start_s = ngx .now ()
300+ local uuid = require (" resty.jit-uuid" )
301+ local x_request_id = uuid .generate_v4 ()
295302
296303 local ok , resp = proxy_client_grpc ({
297304 service = " hello.HelloService.SayHello" ,
@@ -300,6 +307,7 @@ describe("http integration tests with zipkin server [#"
300307 },
301308 opts = {
302309 [" -H" ] = " 'x-b3-sampled: 1'" ,
310+ [" -H" ] = " 'x-request-id: " .. x_request_id .. " '" ,
303311 [" -authority" ] = " grpc-route" ,
304312 }
305313 })
@@ -320,6 +328,7 @@ describe("http integration tests with zipkin server [#"
320328 [" http.method" ] = " POST" ,
321329 [" http.path" ] = " /hello.HelloService/SayHello" ,
322330 [" http.status_code" ] = " 200" , -- found (matches server status)
331+ [" guid:x-request-id" ] = x_request_id ,
323332 lc = " kong" ,
324333 static = " ok" ,
325334 }, request_tags )
0 commit comments