guanjie-pony opened a new issue, #12873:
URL: https://github.com/apache/apisix/issues/12873

   ### Current Behavior
   
   from the document: 
https://apisix.apache.org/docs/apisix/plugins/opentelemetry/ plugin support the 
built-in variables like consumer_name: 
https://apisix.apache.org/docs/apisix/apisix-variable/, but seems it not works, 
my config is here: 
   ```
   apiVersion: apisix.apache.org/v2
   kind: ApisixGlobalRule
   metadata:
     name: tracing-prod
     namespace: ingress-apisix
   spec:
     ingressClassName: apisix-internal
     plugins:
     - config:
         additional_attributes:
         - balancer_ip
         - consumer_name
         sampler:
           name: always_on
       enable: true
       name: opentelemetry
   ```
   test request:
   ```
   curl http://test-redirect.xxxxxxx/info  -H "Authorization: ${jwt_token}"
   ```
   
   we can see trace in jaeger, but no consumer_name
   
   <img width="2491" height="672" alt="Image" 
src="https://github.com/user-attachments/assets/06a36c15-1631-4b01-9945-27262c9b95a0";
 />
   
   but using file-log in log, I can see the consumer_name:
   ```
   {
      "hostname":"apisix-549f49b45b-w7qbr",
      "latency":0.003,
      "upstream_response_time":0.002,
      "response_size":760,
      "url":"/info",
      "upstream_status":"200",
      "uri":"/info",
      
"opentelemetry_context_traceparent":"00-b44ea22321e1af9d2e092060e0366466-a77d28d2e9411a08-01",
      "ingress_class":"apisix-internal",
      "opentelemetry_trace_id":"b44ea22321e1af9d2e092060e0366466",
      "method":"GET",
      "consumer_name":"ingress-apisix_user-pony",
      "service_id":"bdfaae16",
      "service_name":"ingress-apisix_test-redirect_0",
      "route_id":"3cbfb533",
      "user_agent":"curl/7.81.0",
      "region":"common-ack-test",
      "size":256,
      "@timestamp":"2026-01-08T03:02:36+00:00",
      "status":200,
      "opentelemetry_span_id":"a77d28d2e9411a08"
   }
   ```
   
   
   
   ### Expected Behavior
   
   the consumer_name should be in jaeger tracing.
   
   ### Error Logs
   
   _No response_
   
   ### Steps to Reproduce
   
   1. using apisix ingress controller 2.0.0
   2. create a apisixconsumer in jwt
   
   ### Environment
   
   - APISIX version (run `apisix version`): 3.14.1
   - Operating system (run `uname -a`): Linux apisix-549f49b45b-w7qbr 
5.10.134-16.3.al8.x86_64 SMP Tue Mar 26 18:54:05 CST 2024 x86_64 x86_64 x86_64 
GNU/Linux
   - OpenResty / Nginx version (run `openresty -V` or `nginx -V`): nginx 
version: openresty/1.27.1.2
   
   


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