-
Notifications
You must be signed in to change notification settings - Fork 145
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
Nginx 1.22.0 doesn't start with OpenTelemetry enabled #199
Comments
Seems to be addressed in PR #205. |
@jmadureira #205 takes care of "instrumentation/otel-webserver-module" directory which also has opentelemetry module for nginx. |
We have the same problem with |
@rcjsuen, @jmadureira you may check my PR on nginx repo kubernetes/ingress-nginx#9062. |
@esigo Yeah, I also came across kubernetes/ingress-nginx#8585 and kubernetes/ingress-nginx#9017 while trying to figure out this At this rate it might be better to just wait for the official release of OpenTelemetry support in the Nginx controller in my case. |
Compiling gRPC manually seems like a workaround...? 🤔 FROM nginx:1.22.0-alpine as builder
RUN apk update \
&& apk add --update \
alpine-sdk build-base cmake linux-headers libressl-dev pcre-dev zlib-dev \
curl-dev protobuf-dev c-ares-dev \
re2-dev abseil-cpp
ENV GRPC_VERSION v1.43.2
RUN git clone --shallow-submodules --depth 1 --recurse-submodules -b ${GRPC_VERSION} \
https://github.com/grpc/grpc \
&& cd grpc \
&& mkdir -p cmake/build \
&& cd cmake/build \
&& cmake \
-DgRPC_INSTALL=ON \
-DgRPC_BUILD_TESTS=OFF \
-DCMAKE_INSTALL_PREFIX=/install \
-DCMAKE_BUILD_TYPE=Release \
-DgRPC_BUILD_GRPC_NODE_PLUGIN=OFF \
-DgRPC_BUILD_GRPC_OBJECTIVE_C_PLUGIN=OFF \
-DgRPC_BUILD_GRPC_PHP_PLUGIN=OFF \
-DgRPC_BUILD_GRPC_PHP_PLUGIN=OFF \
-DgRPC_BUILD_GRPC_PYTHON_PLUGIN=OFF \
-DgRPC_BUILD_GRPC_RUBY_PLUGIN=OFF \
../.. \
&& make -j2 \
&& make install
ENV OPENTELEMETRY_VERSION v1.3.0
RUN git clone --shallow-submodules --depth 1 --recurse-submodules -b ${OPENTELEMETRY_VERSION} \
https://github.com/open-telemetry/opentelemetry-cpp.git \
&& cd opentelemetry-cpp \
&& mkdir build \
&& cd build \
&& cmake -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/install \
-DCMAKE_PREFIX_PATH=/install \
-DWITH_ZIPKIN=OFF \
-DWITH_JAEGER=OFF \
-DWITH_OTLP=ON \
-DWITH_OTLP_GRPC=ON \
-DWITH_OTLP_HTTP=OFF \
-DBUILD_TESTING=OFF \
-DWITH_EXAMPLES=OFF \
-DWITH_ABSEIL=ON \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
.. \
&& make -j2 \
&& make install
RUN git clone https://github.com/open-telemetry/opentelemetry-cpp-contrib.git \
&& cd opentelemetry-cpp-contrib/instrumentation/nginx \
&& mkdir build \
&& cd build \
&& cmake -DCMAKE_BUILD_TYPE=Release \
-DNGINX_BIN=/usr/sbin/nginx \
-DCMAKE_PREFIX_PATH=/install \
-DCMAKE_INSTALL_PREFIX=/usr/lib/nginx/modules \
-DCURL_LIBRARY=/usr/lib/libcurl.so.4 \
.. \
&& make -j2 \
&& make install
FROM nginx:1.22.0-alpine
RUN apk update \
&& apk add --update \
grpc protobuf c-ares
# gdb # uncomment this if you need to debug nginx
COPY --from=builder /usr/lib/nginx/modules/otel_ngx_module.so /usr/lib/nginx/modules/
COPY nginx.conf /etc/nginx/nginx.conf
# CMD ["/usr/sbin/nginx-debug", "-g", "daemon off;"] |
The symbols were not found for k8s-nginx mainly because the shared libraries were not copied over to the controller container from the init container: |
Yeah, I went down the path of manual compiling gRPC because I saw that in the ingress controller project. |
Also tested with manual gRPC compilation and including the shared libraries and it works as expected:
It would be nice if the > 15 minutes of gRPC compilation could be avoided. |
Thanks for verifying, @jmadureira!
Agreed. This step burns through a lot of compute resources in the CI pipeline. Not sure if this is an issue with Alpine itself or what. There may also be additional cmake flags that could be configured to reduce the compilation time some more... 🤔 |
Hi, |
Describe your environment
The issue was detected when using:
Steps to reproduce
It is possible to reproduce using the following Dockerfile and nginx.conf sample:
What is the expected behavior?
Nginx should start normally
What is the actual behavior?
Nginx logs the following messages and fails:
Additional context
The text was updated successfully, but these errors were encountered: