nginxinc / nginx-otel

Apache License 2.0
165 stars 19 forks source link

How to build the nginx-otel module on a RHEL / CentOS based system #50

Open royteeuwen opened 7 months ago

royteeuwen commented 7 months ago

Describe the bug

I am trying to build the nginx-otel module by first building nginx from source with ./configure --with-compat and then executing the commands in the README.md, but they fail because a lot of the packages mentioned are not available:

Error: Unable to find a match: build-essential libssl-dev zlib1g-dev libpcre3-dev libc-ares-dev libre2-dev

Is there a guide somewhere on how to build this for CentOS based servers?

mtbChef commented 7 months ago

Hello, those are 3rd-party dependency libraries that will need to be installed or built from source. The README contains instructions for installing these libraries on Ubuntu/Debian systems. You will need to alter these commands slightly in order to use a package manager that's available on your CentOS system. This is likely to be yum.

royteeuwen commented 7 months ago

@mtbChef cant you give the 3rd party deps? You distribute a rhel based version as stated in the readme, so you must have a list for it ?

mtbChef commented 7 months ago

@royteeuwen can you clarify? We don't distribute 3rd-party dependencies. They can be installed via apt/yum directly from the 3rd parties. We provide a list in the README:

sudo apt install cmake build-essential libssl-dev zlib1g-dev libpcre3-dev
sudo apt install pkg-config libc-ares-dev libre2-dev # for gRPC
royteeuwen commented 7 months ago

@mtbChef you distribute the nginx-otel-module compiled on a rhel based system via yum. So could you give the instructions / a list of yum deps that you used to build that module. The list you give is for ubuntu based systems, which doesnt work on rhel based systems

royteeuwen commented 7 months ago

@mtbChef any possible help with this? Or anyone else who could provide the list of yum dependencies required to build this module on a RHEL based system? It must be available somewhere, else you wouldn't have been able to distribute it as built yum package yourselves...

p-pautov commented 7 months ago

If you are building Nginx from source, then you should have most of these packages already installed. CentOS equivalents of last two seem to be "c-ares-devel" and "re2-devel" and if you are building from latest commit RE2 is not required.

thresheek commented 6 months ago

Hi @royteeuwen ! The packaging sources for our packages are available at https://hg.nginx.org/pkg-oss/file/26ae41eb0f32/rpm/SPECS/Makefile.module-otel - it's somewhat convoluted though for a first-time looker :)

We ship and build most of dependencies of the module in the packaging. From the OS, we only rely on cmake, re2 and c-ares libraries:

BuildRequires: cmake
BuildRequires: pkgconfig(re2) pkgconfig(libcares)

Everything else (protobuf, abseil, grpc and opentelemetry-cpp) are built from source w/o relying on distro-provided packages - which are not there for a majority of OSes we support - which is why we have to build them from source.

Hope this help!

thresheek commented 6 months ago

That means is that you probably just need a dnf install cmake pkgconfig(re2) pkgconfig(libcares) to bootstrap the build process.

sungy2014 commented 2 months ago

Hi, could anyone document the steps for building Nginx with Otel on RHEL OS?