circlelychen opened a new issue, #10239:
URL: https://github.com/apache/apisix/issues/10239

   ### Description
   
   Hi guys, 
   
   We enable apisix opentelemetry plugin with **trace_id_source  =  
x-request-id** over **istio service mesh**. I got following error in apisix log
   
   ```bash
   bad argument #1 to '?' (invalid value)
   stack traceback:
   coroutine 0:
           [C]: in function 'gsub'
           ...deps/share/lua/5.1/opentelemetry/trace/exporter/encoder.lua:21: 
in function 'hex2bytes'
   ```
   The root cause is x-request-id header must be match with **regex 
[0-9a-f]{32}** since trace_Id only support that pattern.  However, x-request-id 
is generated by istio service mesh with "-"(hyphen) between hex-style 
character, e.g. **84961386-6d84-929d-98bd-c5aee93b5c88**. These "-"(hyphen) 
contribute the error  hex2bytes function in opentelemetry-lua.
   
   In our use cases, removing istio service mesh is forbidden and we regard 
this "-"hyphen embedded x-request-id as global unique trace_id cross multiple 
Kubernetes for single request life cycle. 
   
   Is there any best practice or guidelines for us to integrate apisix 
opentelemetry over istio service mesh?   Please advise
   
   Thanks 
   
   ### Environment
   
   - APISIX version (run `apisix version`): 3.4
   - Operating system (run `uname -a`): redhat
   - OpenResty / Nginx version (run `openresty -V` or `nginx -V`):
   - etcd version, if relevant (run `curl 
http://127.0.0.1:9090/v1/server_info`): none. standalone mode
   - APISIX Dashboard version, if relevant: none
   - Plugin runner version, for issues related to plugin runners: none
   - LuaRocks version, for installation issues (run `luarocks --version`):
   


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