open-telemetry / opentelemetry-cpp-contrib

https://opentelemetry.io/
Apache License 2.0
123 stars 137 forks source link

unknown directive "NginxModuleAttributes" #402

Open alexciw opened 6 months ago

alexciw commented 6 months ago

Environment: openresty 1.25.3 opentelemetry-cpp-contrib version: v1.0.4 Refer to this document: https://opentelemetry.io/blog/2022/instrument-nginx/ I have the following configuration, after the configuration is complete when using openresty -t calibration it shows error unknown directive "NginxModuleAttributes". Removing the NginxModuleAttributes configuration checksum is as expected.

NginxModuleEnabled ON;
NginxModuleOtelSpanExporter otlp;
NginxModuleOtelExporterEndpoint trace.cloud.net:4317;
NginxModuleServiceName openresty;
NginxModuleServiceNamespace devops;
NginxModuleServiceInstanceId openresty.docker;
NginxModuleResolveBackends ON;
NginxModuleTraceAsError ON;
NginxModuleAttributes tps.tenant.id 123445;
G-Akiraka commented 5 months ago

nginx 1.24.0 The same as yours
2024/04/08 17:58:57 [emerg] 224#224: unknown directive "NginxModuleAttributes" in /etc/nginx/conf.d/opentelemetry_module.conf:11