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


##########
apisix/plugins/zipkin/codec.lua:
##########
@@ -97,11 +97,13 @@ local function new_injector()
         headers["x-b3-parentspanid"] = span_context.parent_id
                                     and to_hex(span_context.parent_id) or nil
         headers["x-b3-spanid"] = to_hex(span_context.span_id)
-        -- when we call this function, we already start to sample
-        headers["x-b3-sampled"] = "1"
+        headers["x-b3-sampled"] = span_context:get_baggage_item("x-b3-sampled")
         for key, value in span_context:each_baggage_item() do
-            -- XXX: https://github.com/opentracing/specification/issues/117
-            headers["uberctx-"..key] = ngx.escape_uri(value)
+            -- skip x-b3-sampled baggage
+            if key ~= "x-b3-sampled" then
+                -- XXX: https://github.com/opentracing/specification/issues/117
+                headers["uberctx-"..key] = ngx.escape_uri(value)

Review Comment:
   The uberctx does not depend on "x-b3-sampled".
   
   ref:  
https://github.com/apache/apisix/pull/8099/files#diff-d7b683eff2eae613bb495064140483bd2d223010b83563842f57433f1501cc64R205-R210
   
   baggage is used to pass  "x-b3-sampled", so we need to skip this item. Or 
any suggestions?  Looking forward to your reply. @spacewander 
   
   ps: I will fix the CI later
   
   
   
   



-- 
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