Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

otel_ngx_module.cpp:1:10: fatal error: opentelemetry/sdk/trace/processor.h: No such file or directory #146

Open
zx8086 opened this issue Apr 15, 2022 · 5 comments
Labels
bug Something isn't working

Comments

@zx8086
Copy link

zx8086 commented Apr 15, 2022

Describe your environment

nginx 1.20.2
Raspberry Pi 4
Bullseye
Linux 5.15.33-v8+ #1540 SMP PREEMPT Mon Apr 11 13:18:30 BST 2022 aarch64 GNU/Linux

Steps to reproduce
Ran
./configure --with-compat --add-dynamic-module=/home/pi/opentelemetry-cpp-contrib/instrumentation/nginx

Tail end of the log as below :

`configuring additional dynamic modules
adding module in /home/pi/opentelemetry-cpp-contrib/instrumentation/nginx

  • otel_ngx_module was configured
    checking for PCRE library ... found
    checking for PCRE JIT support ... found
    checking for zlib library ... found
    creating objs/Makefile

Configuration summary

  • using system PCRE library
  • OpenSSL library is not used
  • using system zlib library

nginx path prefix: "/usr/local/nginx"
nginx binary file: "/usr/local/nginx/sbin/nginx"
nginx modules path: "/usr/local/nginx/modules"
nginx configuration prefix: "/usr/local/nginx/conf"
nginx configuration file: "/usr/local/nginx/conf/nginx.conf"
nginx pid file: "/usr/local/nginx/logs/nginx.pid"
nginx error log file: "/usr/local/nginx/logs/error.log"
nginx http access log file: "/usr/local/nginx/logs/access.log"
nginx http client request body temporary files: "client_body_temp"
nginx http proxy temporary files: "proxy_temp"
nginx http fastcgi temporary files: "fastcgi_temp"
nginx http uwsgi temporary files: "uwsgi_temp"
nginx http scgi temporary files: "scgi_temp"`

After ran the following:

make modules

What is the expected behavior?

Expected to see the module created

What is the actual behavior?

make -f objs/Makefile modules make[1]: Entering directory '/home/pi/nginx-1.20.2' cc -c -fPIC -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \ -o objs/addon/src/agent_config.o \ /home/pi/opentelemetry-cpp-contrib/instrumentation/nginx/src/agent_config.cpp cc -c -fPIC -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \ -o objs/addon/src/nginx_config.o \ /home/pi/opentelemetry-cpp-contrib/instrumentation/nginx/src/nginx_config.cpp cc -c -fPIC -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \ -o objs/addon/src/otel_ngx_module.o \ /home/pi/opentelemetry-cpp-contrib/instrumentation/nginx/src/otel_ngx_module.cpp /home/pi/opentelemetry-cpp-contrib/instrumentation/nginx/src/otel_ngx_module.cpp:1:10: fatal error: opentelemetry/sdk/trace/processor.h: No such file or directory 1 | #include <opentelemetry/sdk/trace/processor.h> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated. make[1]: *** [objs/Makefile:1246: objs/addon/src/otel_ngx_module.o] Error 1 make[1]: Leaving directory '/home/pi/nginx-1.20.2' make: *** [Makefile:16: modules] Error 2

Additional context
Add any other context about the problem here.

@zx8086 zx8086 added the bug Something isn't working label Apr 15, 2022
@zx8086 zx8086 changed the title /opentelemetry-cpp-contrib/instrumentation/nginx/src/otel_ngx_module.cpp:1:10: fatal error: opentelemetry/sdk/trace/processor.h: No such file or directory otel_ngx_module.cpp:1:10: fatal error: opentelemetry/sdk/trace/processor.h: No such file or directory Apr 15, 2022
@owent
Copy link
Member

owent commented May 9, 2022

I think you should build opentelemetry-cpp first and add the include directories and libraries by CFLAGS and LDFLAGS if you use configure but not the cmake build system in our repository.

@zx8086
Copy link
Author

zx8086 commented May 10, 2022

opentelemetry-cpp

Any steps / instructions on this ?

@rcjsuen
Copy link
Contributor

rcjsuen commented May 10, 2022

opentelemetry-cpp

Any steps / instructions on this ?

Perhaps this document may be of use to you.

@zx8086
Copy link
Author

zx8086 commented May 22, 2022

@rcjsuen @owent Step 5 & Incorporating into an existing CMake Project, is where i am getting stuck... where and what parameters needed to ensure the headers are installed in the right place to otel_ngx_module.cpp to pick up all the headers created via the opentelemetry-cpp instructions, which i completed without issues.

@owent
Copy link
Member

owent commented May 22, 2022

@rcjsuen @owent Step 5 & Incorporating into an existing CMake Project, is where i am getting stuck... where and what parameters needed to ensure the headers are installed in the right place to otel_ngx_module.cpp to pick up all the headers created via the opentelemetry-cpp instructions, which i completed without issues.

You should add <install_root> of opentelemetry-cpp to cmake search path when building otel_ngx_module.
For example:

cd <where to build opentelemetry>
cmake --install . --prefix /opt/opentelemetry-cpp

cd <where to build otel_ngx_module>
cmake <the directory contains CMakeLists.txt of otel_ngx_module> -Dopentelemetry-cpp_ROOT=/opt/opentelemetry-cpp
# or using -DCMAKE_PREFIX_PATH=/opt/opentelemetry-cpp to replace -Dopentelemetry-cpp_ROOT=/opt/opentelemetry-cpp when using cmake 3.11 or lower
cmake --build . -j

See https://cmake.org/cmake/help/latest/command/find_package.html for details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants