Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

help request: How to create a root span while ignoring the traceparent in the request header. #11266

Open
bai-ming opened this issue May 20, 2024 · 0 comments
Labels
question label for questions asked by users

Comments

@bai-ming
Copy link

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 apisix 脚本stop、reload 也需要增加 -c 参数指定 nginx.conf 路径 #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
@nfrankel nfrankel added the question label for questions asked by users label May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question label for questions asked by users
Projects
Status: 📋 Backlog
Development

No branches or pull requests

2 participants