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
Current Behavior
When enabling
set_ngx_varin 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
Steps to Reproduce
Enable the opentelemetry plugin and set the following plugin metadata
Environment
apisix version): apache/apisix:3.13.0-debianuname -a): Linux/Dockeropenresty -Vornginx -V): as per docker imageluarocks --version): as per docker image