From 769fc90818c5c6334ecf07460efda557bcea71f9 Mon Sep 17 00:00:00 2001 From: Richard Date: Fri, 9 Oct 2026 18:50:46 +0100 Subject: [PATCH] [STO-928] Return X-Trace-ID on every response and pin the OTel module add_header without 'always' only applies to 200, 201, 204, 206 and 3xx responses, so 202s and every error response went out without a trace ID. nginx-module-otel was installed unpinned from the nginx mainline repo. Its latest build depends on nginx 1.31.6, which upgraded nginx past the 1.31.3 source the headers-more module is compiled against, so a fresh build of master fails to start. --- CHANGELOG.md | 5 +++++ Dockerfile | 3 ++- config/http.conf | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d82b5f4..e037735 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 1.31.3-1 + +* Return `X-Trace-ID` on every response, including `202` and `4xx`/`5xx`. +* Pin `nginx-module-otel` to the base image's nginx version. + ## 1.31.3 * Update base image to `zappi/nginx:1.31.3` (Debian Trixie). diff --git a/Dockerfile b/Dockerfile index 7b20c36..68f84ec 100644 --- a/Dockerfile +++ b/Dockerfile @@ -56,9 +56,10 @@ RUN apt-get update -y && \ wget # Module: OpenTelemetry (OTel) +ARG NGINX_OTEL_VERSION="0.1.2-1~trixie" RUN apt-get update -y && \ apt-get install --no-install-recommends -y \ - nginx-module-otel && \ + "nginx-module-otel=${NGINX_VERSION}+${NGINX_OTEL_VERSION}" && \ rm -rf /var/lib/apt/lists/* /tmp/* # Copy compiled module diff --git a/config/http.conf b/config/http.conf index c31b2e1..99de6b2 100644 --- a/config/http.conf +++ b/config/http.conf @@ -114,7 +114,7 @@ http { add_header X-Proxy-Request-Time $request_time; # Observability headers - add_header X-Trace-ID $otel_trace_id; + add_header X-Trace-ID $otel_trace_id always; gzip on; gzip_comp_level 5;