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

   ### Current Behavior
   
   When enabling `set_ngx_var` in the opentelemetry plugin apisix errors out 
during startup.
   
   This worked prior to PR #11940. Looking at 
https://github.com/apache/apisix/blob/3.13.0/apisix/cli/ops.lua#L554 it appears 
that the part of the code to setup the required nginx variable wasn't migrated 
to use plugin metadata and is still using plugin attributes.
   
   ### Expected Behavior
   
   _No response_
   
   ### Error Logs
   
   ```
   "2025/07/07 01:32:59 [error] 38#38: *291 lua entry thread aborted: runtime 
error: /usr/local/apisix/apisix/plugins/opentelemetry.lua:374: variable 
"opentelemetry_context_traceparent" not found for writing; maybe it is a 
built-in variable that is not changeable or you forgot to use "set 
$opentelemetry_context_traceparent '';" in the config file to define it first"
   ```
   
   ### Steps to Reproduce
   
   Enable the opentelemetry plugin and set the following plugin metadata
   
   ```
   "plugin_metadata":
     - "collector":
         "address": "127.0.0.1:4318"
         "request_timeout": 3
       "id": "opentelemetry"
       "set_ngx_var": true
   ```
   
   ### Environment
   
   - APISIX version (run `apisix version`): apache/apisix:3.13.0-debian
   - Operating system (run `uname -a`): Linux/Docker
   - OpenResty / Nginx version (run `openresty -V` or `nginx -V`): as per 
docker image
   - LuaRocks version, for installation issues (run `luarocks --version`): as 
per docker image
   


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