nginx-otel icon indicating copy to clipboard operation
nginx-otel copied to clipboard

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

Open royteeuwen opened this issue 10 months ago • 9 comments

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?

royteeuwen avatar Apr 04 '24 12:04 royteeuwen

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.

mtbChef avatar Apr 09 '24 22:04 mtbChef

@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 ?

royteeuwen avatar Apr 10 '24 06:04 royteeuwen

@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

mtbChef avatar Apr 10 '24 19:04 mtbChef

@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 avatar Apr 11 '24 04:04 royteeuwen

@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...

royteeuwen avatar Apr 16 '24 06:04 royteeuwen

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.

p-pautov avatar Apr 16 '24 08:04 p-pautov

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 avatar Apr 23 '24 20:04 thresheek

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

thresheek avatar Apr 23 '24 20:04 thresheek

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

sungy2014 avatar Sep 06 '24 15:09 sungy2014