From c59ea8421bccf99519edb479ccea7f7e53fe01e5 Mon Sep 17 00:00:00 2001 From: Attila Szegedi Date: Mon, 27 Apr 2026 14:39:35 +0200 Subject: [PATCH] Fix node profiling scenarios broken by dd-trace-js DD_TRACING_ENABLED change dd-trace-js PR #6982 made DD_TRACING_ENABLED=0 disable the whole tracer module via NoopProxy, which also stops the profiler from starting. Switch node_heap, node_heap_oom, and node_wall_cpu to keep the proxy alive via DD_DYNAMIC_INSTRUMENTATION_ENABLED=true (on the allowlist from PR #7916) until dd-trace-js adds DD_PROFILING_ENABLED to that allowlist. Also disable telemetry: its beforeExit HTTP request allocates thousands of objects that dominated the heap snapshots and skewed percentage assertions in node_heap and node_heap_oom. --- scenarios/node_heap/Dockerfile | 9 +++++++++ scenarios/node_heap_oom/Dockerfile | 9 +++++++++ scenarios/node_wall_cpu/Dockerfile | 9 +++++++++ 3 files changed, 27 insertions(+) diff --git a/scenarios/node_heap/Dockerfile b/scenarios/node_heap/Dockerfile index 574ae94..e22a11e 100644 --- a/scenarios/node_heap/Dockerfile +++ b/scenarios/node_heap/Dockerfile @@ -13,7 +13,16 @@ ENV DD_PROFILING_PPROF_PREFIX="/app/data/profiles_" ENV DD_PROFILING_EXPORTERS=file ENV DD_PROFILING_ENABLED=1 ENV DD_TRACING_ENABLED=0 +# TEMPORARY: Since dd-trace-js PR #6982, DD_TRACING_ENABLED=0 also disables the +# entire tracer module (NoopProxy), which prevents the profiler from starting. +# DD_DYNAMIC_INSTRUMENTATION_ENABLED=true is on the allowlist (added in PR #7916) +# that keeps the real proxy alive while tracing stays off. Remove once dd-trace-js +# adds DD_PROFILING_ENABLED to that allowlist. +ENV DD_DYNAMIC_INSTRUMENTATION_ENABLED=true ENV DD_REMOTE_CONFIGURATION_ENABLED=0 +# Disable telemetry so its beforeExit HTTP request doesn't allocate thousands +# of objects that dominate the heap snapshot and skew percentage assertions. +ENV DD_INSTRUMENTATION_TELEMETRY_ENABLED=false ENV DD_PROFILING_PROFILERS=space ENV DD_TRACE_DEBUG=1 CMD node --expose-gc -r dd-trace/init main.js diff --git a/scenarios/node_heap_oom/Dockerfile b/scenarios/node_heap_oom/Dockerfile index d894633..a1e847d 100644 --- a/scenarios/node_heap_oom/Dockerfile +++ b/scenarios/node_heap_oom/Dockerfile @@ -13,7 +13,16 @@ ENV DD_PROFILING_PPROF_PREFIX="/app/data/profiles_" ENV DD_PROFILING_EXPORTERS=file ENV DD_PROFILING_ENABLED=1 ENV DD_TRACING_ENABLED=0 +# TEMPORARY: Since dd-trace-js PR #6982, DD_TRACING_ENABLED=0 also disables the +# entire tracer module (NoopProxy), which prevents the profiler from starting. +# DD_DYNAMIC_INSTRUMENTATION_ENABLED=true is on the allowlist (added in PR #7916) +# that keeps the real proxy alive while tracing stays off. Remove once dd-trace-js +# adds DD_PROFILING_ENABLED to that allowlist. +ENV DD_DYNAMIC_INSTRUMENTATION_ENABLED=true ENV DD_REMOTE_CONFIGURATION_ENABLED=0 +# Disable telemetry so its beforeExit HTTP request doesn't allocate thousands +# of objects that dominate the heap snapshot and skew percentage assertions. +ENV DD_INSTRUMENTATION_TELEMETRY_ENABLED=false ENV DD_PROFILING_PROFILERS=space ENV DD_PROFILING_EXPERIMENTAL_OOM_MONITORING_ENABLED=1 ENV DD_TRACE_DEBUG=1 diff --git a/scenarios/node_wall_cpu/Dockerfile b/scenarios/node_wall_cpu/Dockerfile index c67e03c..cdefe00 100644 --- a/scenarios/node_wall_cpu/Dockerfile +++ b/scenarios/node_wall_cpu/Dockerfile @@ -13,7 +13,16 @@ ENV DD_PROFILING_PPROF_PREFIX="/app/data/profiles_" ENV DD_PROFILING_EXPORTERS=file ENV DD_PROFILING_ENABLED=1 ENV DD_TRACING_ENABLED=0 +# TEMPORARY: Since dd-trace-js PR #6982, DD_TRACING_ENABLED=0 also disables the +# entire tracer module (NoopProxy), which prevents the profiler from starting. +# DD_DYNAMIC_INSTRUMENTATION_ENABLED=true is on the allowlist (added in PR #7916) +# that keeps the real proxy alive while tracing stays off. Remove once dd-trace-js +# adds DD_PROFILING_ENABLED to that allowlist. +ENV DD_DYNAMIC_INSTRUMENTATION_ENABLED=true ENV DD_REMOTE_CONFIGURATION_ENABLED=0 +# Disable telemetry so its beforeExit HTTP request doesn't allocate objects +# that contaminate the profiles and skew percentage assertions. +ENV DD_INSTRUMENTATION_TELEMETRY_ENABLED=false ENV DD_PROFILING_PROFILERS=wall ENV DD_PROFILING_EXPERIMENTAL_CPU_ENABLED=1 ENV DD_TRACE_DEBUG=1