Open zhendongcmss opened 1 week ago
You can remove the plugin request-id
then try again.
While the default trace_id_source
of opentelemetry
plugin is x-request-id
, if the x-request-id
is not a valid traceID, it would not been reported.
the doc: https://apisix.apache.org/docs/apisix/plugins/opentelemetry/#configuring-the-collector
I removed request-id
plugin then try curl http://127.0.0.1:9080/123 -H "X-Request-Id: 1272b56c15a7866668b943071c176805"
trace_id_ratio doesn't work too. apisix always send the trace.
If curl
without request-id, trace_id_ratio
it can work.
There is a sampled flag in the trace id, the opentelemetry plugin will respect the flag.
Maybe you should check the source code here https://github.com/yangxikun/opentelemetry-lua/blob/main/lib/opentelemetry/trace/sampling/trace_id_ratio_sampler.lua#L34
Current Behavior
set upstream
set opentelemetry
send request with curl
curl http://127.0.0.1:9080/vv
100 timesExpected Behavior
The plugin should have a 50% chance of sending a trace, but in reality, no trace was sent, and I saw that there was no testing for this part in the test case
Error Logs
No response
Steps to Reproduce
as
Current Behavior
descriptionEnvironment
apisix version
): master branchuname -a
): Linux myapisixnode 3.10.0-1160.el7.x86_64 #1 SMP Mon Oct 19 16:18:59 UTC 2020 x86_64 x86_64 x86_64 GNU/Linuxopenresty -V
ornginx -V
):curl http://127.0.0.1:9090/v1/server_info
): 3.5.10luarocks --version
):