[Tracing] trace-flag of header 'Traceparent' is always '01' no matter the value of tracing_sampling_rate. #11626
Labels
pending author feedback
Waiting for the issue author to get back to a maintainer with findings, more details, etc...
Is there an existing issue for this?
Kong version (
$ kong version
)Kong 3.4.0
Current Behavior
Regarding to the definition of header
Traceparent
, the last field should be represented this span is recored or not.For example, no matter the value of
tracing_sampling_rate
is set, kong always sets the the trace-flag ofTraceparent
to01
.It causes the behavior of Kong is doing the sampling correctly regarding to
tracing_sampling_rate
, but always tells the upstream 'this span should be recorded'. Child span respects parent span's flag to determine if this span should be recored or not, so since kong always set it to 01, it makes child span will be always recorded.Expected Behavior
The last flag should
00
if kong does not record this span.Steps To Reproduce
tracing_sampling_rate
to 0.5Traceparent
01
no matter kong recored the span or not.Anything else?
the value of
balancer_span.should_sample
is alwaystrue
(ref: https://github.com/Kong/kong/blob/3.4.0/kong/plugins/opentelemetry/handler.lua#L129), so that the trace-flag is always 01 in this function. (ref: https://github.com/Kong/kong/blob/3.4.0/kong/tracing/propagation.lua#L589)@samugi
I am not sure if it related to #11468
No response
The text was updated successfully, but these errors were encountered: