From 7e754e26f48884db355839afe01ffb0a4bcadc20 Mon Sep 17 00:00:00 2001 From: Peter Souter Date: Fri, 12 Sep 2025 23:57:56 +0100 Subject: [PATCH 1/3] docs(nginx): update version, add hex format example, improve pipeline explanation - Update NGINX version from 1.26.0 to 1.29.0 (1.26 is EOL per endoflife.date) - Add example log showing hexadecimal format of trace and span IDs - Reword pipeline configuration explanation for clarity --- .../trace_collection/proxy_setup/nginx.md | 43 +++++++++++-------- 1 file changed, 26 insertions(+), 17 deletions(-) diff --git a/content/en/tracing/trace_collection/proxy_setup/nginx.md b/content/en/tracing/trace_collection/proxy_setup/nginx.md index ad01a78cc77..d54b558dfe1 100644 --- a/content/en/tracing/trace_collection/proxy_setup/nginx.md +++ b/content/en/tracing/trace_collection/proxy_setup/nginx.md @@ -62,7 +62,7 @@ if [ -z "$ARCH" ]; then exit 1 fi -NGINX_VERSION="1.26.0" +NGINX_VERSION="1.29.0" RELEASE_TAG=$(get_latest_release DataDog/nginx-datadog) TARBALL="ngx_http_datadog_module-${ARCH}-${NGINX_VERSION}.so.tgz" @@ -399,29 +399,38 @@ After saving your changes, reload the NGINX configuration. For example: ```sh sudo nginx -s reload ``` + ### Step 2: Configure the log pipeline to parse the trace and span IDs -Next, create a pipeline to process the trace ID from your logs. These steps are the same for both instrumentation methods. +The trace and span IDs in the logs will be in hexadecimal format: + +``` +10.244.0.1 - - [12/Sep/2025:22:41:03 +0000] "GET /health HTTP/1.1" 200 87 0.002 "-" "kube-probe/1.32" "-" dd.trace_id="68c4a17f000000009aed12af2ccb1ead" dd.span_id="9aed12af2ccb1ead" +``` + +This means you'll need to remap them as decimal for logs and trace correlation to work in Datadog. + +To fix this, you'll need to create a pipeline to process the trace ID from your logs. These steps are the same for both instrumentation methods. 1. In Datadog, navigate to the [**Log Configuration**][9] page. -1. Hover over your active NGINX pipeline and click the **Clone** icon to create an editable version. -1. Click the cloned pipeline. -1. Click **Add Processor**. -1. Select [Grok Parser][11] as the processor type. -1. Define the following parsing rule to extract the trace ID attribute from a log event. This rule works for both the Datadog module and OpenTelemetry outputs: +2. Hover over your active NGINX pipeline and click the **Clone** icon to create an editable version. +3. Click the cloned pipeline. +4. Click **Add Processor**. +5. Select [Grok Parser][11] as the processor type. +6. Define the following parsing rule to extract the trace ID attribute from a log event. This rule works for both the Datadog module and OpenTelemetry outputs: ```text extract_correlation_ids %{data} dd.trace_id="%{notSpace:dd.trace_id:nullIf("-")}" dd.span_id="%{notSpace:dd.span_id:nullIf("-")}" ``` -1. Click **Create**. -1. Click **Add Processor** again. -1. Select [Trace ID Remapper][10] as the processor type. This processor associates the parsed ID with its corresponding APM trace. -1. In the **Set trace id attribute(s)** field, enter `dd.trace_id`. -1. Click **Create**. -1. Click **Add Processor** again. -1. Select [Span ID Remapper][12] as the processor type. This processor associates the parsed ID with its corresponding APM span. -1. In the **Set span id attribute(s)** field, enter `dd.span_id`. -1. Click **Create**. -1. Save and enable your new pipeline. +7. Click **Create**. +8. Click **Add Processor** again. +9. Select [Trace ID Remapper][10] as the processor type. This processor associates the parsed ID with its corresponding APM trace. +10. In the **Set trace id attribute(s)** field, enter `dd.trace_id`. +11. Click **Create**. +12. Click **Add Processor** again. +13. Select [Span ID Remapper][12] as the processor type. This processor associates the parsed ID with its corresponding APM span. +14. In the **Set span id attribute(s)** field, enter `dd.span_id`. +15. Click **Create**. +16. Save and enable your new pipeline. Once the pipeline is active, new NGINX logs are automatically correlated with their traces and spans. From b83512f0d54d19c5e90af9917d41e3e16109bfa6 Mon Sep 17 00:00:00 2001 From: Peter Souter Date: Mon, 15 Sep 2025 15:55:46 +0100 Subject: [PATCH 2/3] Update content/en/tracing/trace_collection/proxy_setup/nginx.md Co-authored-by: DeForest Richards <56796055+drichards-87@users.noreply.github.com> --- content/en/tracing/trace_collection/proxy_setup/nginx.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/en/tracing/trace_collection/proxy_setup/nginx.md b/content/en/tracing/trace_collection/proxy_setup/nginx.md index d54b558dfe1..7c1ebec177e 100644 --- a/content/en/tracing/trace_collection/proxy_setup/nginx.md +++ b/content/en/tracing/trace_collection/proxy_setup/nginx.md @@ -402,7 +402,7 @@ sudo nginx -s reload ### Step 2: Configure the log pipeline to parse the trace and span IDs -The trace and span IDs in the logs will be in hexadecimal format: +By default, logs capture `dd.trace_id` and `dd.span_id` in hexadecimal format: ``` 10.244.0.1 - - [12/Sep/2025:22:41:03 +0000] "GET /health HTTP/1.1" 200 87 0.002 "-" "kube-probe/1.32" "-" dd.trace_id="68c4a17f000000009aed12af2ccb1ead" dd.span_id="9aed12af2ccb1ead" From b40540f6566a09e6870e09dc6a4a5b12e1ac4bb1 Mon Sep 17 00:00:00 2001 From: Peter Souter Date: Mon, 15 Sep 2025 15:55:56 +0100 Subject: [PATCH 3/3] Update content/en/tracing/trace_collection/proxy_setup/nginx.md Co-authored-by: DeForest Richards <56796055+drichards-87@users.noreply.github.com> --- content/en/tracing/trace_collection/proxy_setup/nginx.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/content/en/tracing/trace_collection/proxy_setup/nginx.md b/content/en/tracing/trace_collection/proxy_setup/nginx.md index 7c1ebec177e..f9e4997c983 100644 --- a/content/en/tracing/trace_collection/proxy_setup/nginx.md +++ b/content/en/tracing/trace_collection/proxy_setup/nginx.md @@ -408,9 +408,7 @@ By default, logs capture `dd.trace_id` and `dd.span_id` in hexadecimal format: 10.244.0.1 - - [12/Sep/2025:22:41:03 +0000] "GET /health HTTP/1.1" 200 87 0.002 "-" "kube-probe/1.32" "-" dd.trace_id="68c4a17f000000009aed12af2ccb1ead" dd.span_id="9aed12af2ccb1ead" ``` -This means you'll need to remap them as decimal for logs and trace correlation to work in Datadog. - -To fix this, you'll need to create a pipeline to process the trace ID from your logs. These steps are the same for both instrumentation methods. +To enable log and trace correlation in Datadog, configure a log processing pipeline to convert these IDs from hexadecimal to decimal. Follow the same steps regardless of the instrumentation method you use. 1. In Datadog, navigate to the [**Log Configuration**][9] page. 2. Hover over your active NGINX pipeline and click the **Clone** icon to create an editable version.