From dadb6027bb49be2615e834fe914da85fc02dca1e Mon Sep 17 00:00:00 2001 From: matthias-haase Date: Fri, 15 Nov 2024 14:02:43 +0100 Subject: [PATCH] main-patch-opentelemetry-cpp-and-contrib-and-proto--and--add-in-Dockerfile-apk-abseil-cpp-crc-cpu-detect OPENTELEMETRY_CPP_VERSION="v1.17.0" perl -pi -e "s/(OPENTELEMETRY_CPP_VERSION=)(.)/\1"$OPENTELEMETRY_CPP_VERSION"/g;" images/nginx/rootfs/build.sh OPENTELEMETRY_PROTO_VERSION="v1.3.2" perl -pi -e "s/(OPENTELEMETRY_PROTO_VERSION=)(.)/\1"$OPENTELEMETRY_PROTO_VERSION"/g;" images/nginx/rootfs/build.sh OPENTELEMETRY_CONTRIB_COMMIT=f6d29426ee9b4d6b476c09ca3cb9bed3cf23906f perl -pi -e "s/(OPENTELEMETRY_CONTRIB_COMMIT=)(.)/\1"$OPENTELEMETRY_CONTRIB_COMMIT"/g;" images/nginx/rootfs/build.sh perl -pi -e "s/(libprotobuf.)/\1\n abseil-cpp-crc-cpu-detect \/g;" images/nginx/rootfs/Dockerfile Ingress-NGINX 1.10.0 has dropped support for OpenTracing and Zipkin, favoring OpenTelemetry instead. The OpenTelemetry module used by Ingress-NGINX is based on a old commit, and has received updates since then. The correct value is not set according "span->SetStatus(trace::StatusCode::kError);". Per default it's not correct set with "span->SetStatus(trace::StatusCode::kOk);" if there a trace with error (>=http_code 500). (in Datadog it's metric trace.nginx.server.errors.) The changes according Ingress-NGINX 1.11.2 with my branch solved the problem according trace error status: https://github.com/tsimonitoring/ingress-nginx/tree/release-1.11.3-patch-opentelemetry-cpp-and-contrib-and-proto As example tested on my side in Datadog. There are correct OPENTELEMETRY_CPP_VERSION, OPENTELEMETRY_PROTO_VERSION, OPENTELEMETRY_CONTRIB_COMMIT in build.sh incl. apk upgrade abseil-cpp-crc-cpu-detect (add) in Dockerfile NGINX. Before (https://i.imgur.com/LpvotMx.png) there was no shipped metric according error_status per OpenTelemetry Module. After (https://i.imgur.com/xvz6b05.png) you can see the shipped error metric also in trace view or see diag example (https://i.imgur.com/xEEY2Ep.png). --- images/nginx/rootfs/Dockerfile | 1 + images/nginx/rootfs/build.sh | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/images/nginx/rootfs/Dockerfile b/images/nginx/rootfs/Dockerfile index 1d2b6b6230..15ddb83c9e 100644 --- a/images/nginx/rootfs/Dockerfile +++ b/images/nginx/rootfs/Dockerfile @@ -51,6 +51,7 @@ RUN apk update \ tzdata \ grpc-cpp \ libprotobuf \ + abseil-cpp-crc-cpu-detect \ && ln -s /usr/local/nginx/sbin/nginx /sbin/nginx \ && adduser -S -D -H -u 101 -h /usr/local/nginx \ -s /sbin/nologin -G www-data -g www-data www-data \ diff --git a/images/nginx/rootfs/build.sh b/images/nginx/rootfs/build.sh index 3baf775fca..4210ccc0e5 100755 --- a/images/nginx/rootfs/build.sh +++ b/images/nginx/rootfs/build.sh @@ -102,9 +102,9 @@ export LUA_RESTY_IPMATCHER_VERSION=3e93c53eb8c9884efe939ef070486a0e507cc5be export MIMALOC_VERSION=v2.1.7 # Check on https://github.com/open-telemetry/opentelemetry-cpp -export OPENTELEMETRY_CPP_VERSION="v1.11.0" +export OPENTELEMETRY_CPP_VERSION="v1.17.0" # Check on https://github.com/open-telemetry/opentelemetry-proto -export OPENTELEMETRY_PROTO_VERSION="v1.1.0" +export OPENTELEMETRY_PROTO_VERSION="v1.3.2" export BUILD_PATH=/tmp/build @@ -512,7 +512,7 @@ make make modules make install -export OPENTELEMETRY_CONTRIB_COMMIT=e11348bb400d5472bf1da5d6128bead66fa111ff +export OPENTELEMETRY_CONTRIB_COMMIT="f6d29426ee9b4d6b476c09ca3cb9bed3cf23906f" cd "$BUILD_PATH" git clone https://github.com/open-telemetry/opentelemetry-cpp-contrib.git opentelemetry-cpp-contrib-${OPENTELEMETRY_CONTRIB_COMMIT}