Skip to content

How to build the nginx-otel-module using configure with add-dynamic-module #49

@royteeuwen

Description

@royteeuwen

Describe the bug

We build NGINX from source code and add nginx-otel as dynamic module, but the following error is thrown:

adding module in /tmp/nginx/nginx-otel
-- The C compiler identification is GNU 8.5.0
-- The CXX compiler identification is GNU 8.5.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:64 (find_package):
  By not providing "Findopentelemetry-cpp.cmake" in CMAKE_MODULE_PATH this
  project has asked CMake to find a package configuration file provided by
  "opentelemetry-cpp", but CMake did not find one.

  Could not find a package configuration file provided by "opentelemetry-cpp"
  with any of the following names:

    opentelemetry-cppConfig.cmake
    opentelemetry-cpp-config.cmake

  Add the installation prefix of "opentelemetry-cpp" to CMAKE_PREFIX_PATH or
  set "opentelemetry-cpp_DIR" to a directory containing one of the above
  files.  If "opentelemetry-cpp" provides a separate development package or
  SDK, be sure it has been installed.

I don't find it anywhere in the docs that another library should be required to build the module?

The commands we are executing:

# Download Nginx source
wget -nv https://nginx.org/download/nginx-$NGINX_VERSION.tar.gz -O nginx.tar.gz
tar -xzf nginx.tar.gz && mv -f nginx-$NGINX_VERSION nginx

# Download nginx-otel
wget -nv https://github.com/nginxinc/nginx-otel/archive/refs/tags/v$NGINX_OTEL_VERSION.tar.gz -O nginx-otel.tar.gz
mkdir nginx-otel
tar -xzf nginx-otel.tar.gz -C nginx-otel --strip-components 1

cd nginx
# Process configuration to compile Nginx, based on parameters from RHEL:8 nginx version
# (using nginx -V, which returns the arguments for ./configure).
./configure --prefix=/etc/nginx \
    --sbin-path=/usr/local/sbin/nginx \
    --modules-path=modules \
    --conf-path=/etc/nginx/conf/nginx.conf \
    --error-log-path=/dev/stderr \
    --http-log-path=/dev/stdout \
    --http-client-body-temp-path=/var/tmp/nginx/client_body \
    --http-proxy-temp-path=/var/tmp/nginx/proxy \
    --http-fastcgi-temp-path=/var/tmp/nginx/fastcgi \
    --http-uwsgi-temp-path=/var/tmp/nginx/uwsgi \
    --http-scgi-temp-path=/var/tmp/nginx/scgi \
    --pid-path=/var/run/nginx/nginx.pid \
    --lock-path=/var/run/nginx/nginx.lock \
    --user=nginx \
    --group=nginx \
    --with-file-aio \
    --with-ipv6 \
    --with-http_ssl_module \
    --with-http_v2_module \
    --with-http_auth_request_module \
    --with-http_realip_module \
    --with-stream_ssl_preread_module \
    --with-http_addition_module \
    --with-http_xslt_module=dynamic \
    --with-http_image_filter_module=dynamic \
    --with-http_sub_module \
    --with-http_dav_module \
    --with-http_flv_module \
    --with-http_mp4_module \
    --with-http_gunzip_module \
    --with-http_gzip_static_module \
    --with-http_random_index_module \
    --with-http_secure_link_module \
    --with-http_degradation_module \
    --with-http_slice_module \
    --with-http_stub_status_module \
    --with-http_perl_module=dynamic \
    --with-http_stub_status_module \
    --with-mail=dynamic \
    --with-mail_ssl_module \
    --with-pcre= \
    --with-pcre-jit \
    --with-stream=dynamic \
    --with-stream_ssl_module \
    --with-debug \
    --with-cc-opt="-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic" \
    --with-ld-opt="-Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,-E" \
    --with-pcre="${cwd}/pcre2" \
    --with-pcre-opt="-fPIC" \
    --with-zlib="${cwd}/zlib" \
    --with-zlib-opt="-fPIC" \
    --with-openssl="${cwd}/openssl" \
    --with-openssl-opt="enable-ec_nistp_64_gcc_128 enable-tls1_3 no-ssl2 no-ssl3 no-weak-ssl-ciphers -DOPENSSL_NO_HEARTBEATS" \
    --add-dynamic-module="${cwd}/ngx_brotli" \
    --add-dynamic-module="${cwd}/ngx_devel_kit" \
    --add-dynamic-module="${cwd}/set-misc-nginx-module" \
    --add-dynamic-module="${cwd}/nginx-otel"

# Prepared, so make the puppy
make && make install

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions