Gallardot commented on code in PR #8099:
URL: https://github.com/apache/apisix/pull/8099#discussion_r999158464


##########
apisix/plugins/zipkin.lua:
##########
@@ -163,9 +165,9 @@ function _M.rewrite(plugin_conf, ctx)
         -- pass the trace ids even the sample is rejected
         -- see https://github.com/openzipkin/b3-propagation#why-send-
         -- trace-ids-with-a-reject-sampling-decision
-        core.request.set_header(ctx, "x-b3-traceid", trace_id)
-        core.request.set_header(ctx, "x-b3-parentspanid", parent_span_id)
-        core.request.set_header(ctx, "x-b3-spanid", request_span_id)
+        core.request.set_header(ctx, "x-b3-traceid", trace_id or 
to_hex(rand_bytes(16)))

Review Comment:
   I'm sorry, I didn't get your point. @spacewander 
   
   Why do we need to generate a real root span when no sampling is required and 
the client does not pass a trace ID & span ID? Where does this real root span 
need to be used when no sampling is required?  We do not need to report these 
spans to the zipkin server.
   
   A fake trace ID & span ID are sufficient. Only `upstream headers` and 
`apisix's logs` need these ids



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to