You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "bai-ming (via GitHub)" <gi...@apache.org> on 2024/05/20 08:54:38 UTC

[I] help request: How to create a root span while ignoring the traceparent in the request header. [apisix]

bai-ming opened a new issue, #11266:
URL: https://github.com/apache/apisix/issues/11266

   ### Description
   
   I want to create a root span by x-request-id.
   my config is :
   ```
   opentelemetry:
       trace_id_source: x-request-id
       resource:
         service.name: APISIX
       collector:
         address: 10.142.0.35:4318
         request_timeout: 3
         request_headers:
           Authorization: token
       batch_span_processor:
         drop_on_queue_full: false
         max_queue_size: 1024
         batch_timeout: 2
         inactive_timeout: 1
         max_export_batch_size: 16
   ```
   bug when i open the opentelemetry plugin in the route, the trace_id doesn't equal x-request-id but traceparent.
   I find the code in apisix/plugins/opentelemetry.lua,
   ```
   local upstream_context = trace_context_propagator:extract(context, ngx.req)
   ```
   In the OpenResty , the ngx.req is only read,so I can not change the header of req.
   So what can i do to ignore the traceparent in the request header?
   
   ### Environment
   
   - APISIX version (run `apisix version`): 3.9.0
   - Operating system (run `uname -a`): Linux eb-apisix-deploy-79c5f88c84-5r8v7 4.15.0-212-generic #223-Ubuntu SMP Tue May 23 13:09:22 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
   - OpenResty / Nginx version (run `openresty -V` or `nginx -V`): openresty/1.25.3.1
   - etcd version, if relevant (run `curl http://127.0.0.1:9090/v1/server_info`):3.5.0
   


-- 
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: notifications-unsubscribe@apisix.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] help request: How to create a root span while ignoring the traceparent in the request header. [apisix]

Posted by "Baoyuantop (via GitHub)" <gi...@apache.org>.
Baoyuantop commented on issue #11266:
URL: https://github.com/apache/apisix/issues/11266#issuecomment-4010081368

   You can write a custom plugin with higher priority than OpenTelemetry, and modify the request headers within the plugin.


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] help request: How to create a root span while ignoring the traceparent in the request header. [apisix]

Posted by "Baoyuantop (via GitHub)" <gi...@apache.org>.
Baoyuantop closed issue #11266: help request: How to create a root span while ignoring the traceparent in the request header.
URL: https://github.com/apache/apisix/issues/11266


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org