Setup Nginx metrics with OpenTelemetry to SigNoz
I’m having trouble configuring Nginx 1.18.0 on Debian 12 with OpenTelemetry to send my logs to SigNoz. First of all if I try to install using the package manager I can’t find the package..
apt-get install -y nginx-otel-module
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package nginx-otel-module
If I try to compile the specific module for the Nginx 1.18.0 version I have problems
wget https://github.com/open-telemetry/opentelemetry-cpp-contrib/releases/download/webserver%2Fv1.0.0/opentelemetry-webserver-sdk-x64-linux.tgz.zip -P /opt
cd /opt && unzip opentelemetry-webserver-sdk-x64-linux.tgz.zip
tar -xvfz opentelemetry-webserver-sdk-x64-linux.tgz
./install
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/opentelemetry-webserver-sdk/sdk_lib/lib
echo "load_module /opt/opentelemetry-webserver-sdk/WebServerModule/Nginx/ngx_http_opentelemetry_module.so;\n$(cat /etc/nginx/nginx.conf)" > /etc/nginx/nginx.conf
also edit nginx.conf and add
http {
opentelemetry_config /etc/nginx/opentelemetry_config.yaml;
}
then check nginx config and i get error
nginx -t
nginx: [emerg] unknown directive “opentelemetry_config” in /etc/nginx/nginx.conf:63
nginx: configuration file /etc/nginx/nginx.conf test failed
Read more here: Source link
