Skip to content

Fix node profiling scenarios broken by dd-trace-js DD_TRACING_ENABLED change#115

Merged
szegedi merged 1 commit intomainfrom
szegedi/node-profiler-tracing-disabled-fix
Apr 27, 2026
Merged

Fix node profiling scenarios broken by dd-trace-js DD_TRACING_ENABLED change#115
szegedi merged 1 commit intomainfrom
szegedi/node-profiler-tracing-disabled-fix

Conversation

@szegedi
Copy link
Copy Markdown
Contributor

@szegedi szegedi commented Apr 27, 2026

Summary

The nightly node CI job has been failing on node_heap, node_heap_oom, and node_wall_cpu with No matching files found for *.pprof — no profile files were being produced at all. Root-caused to dd-trace-js PR #6982 (commit a995feed41, merged 2026-01-22), which switched the DD_TRACE_ENABLED lookup in packages/dd-trace/src/index.js from getEnvironmentVariable to getValueFromEnvSources. The new helper resolves aliases, so DD_TRACING_ENABLED=0 (declared as an alias of DD_TRACE_ENABLED in supported-configurations.json) now flips the package export to NoopProxy — which means the profiler never starts.

Fix:

  • Add DD_DYNAMIC_INSTRUMENTATION_ENABLED=true to keep the real proxy alive (it's on the allowlist added in PR #7916) while leaving tracing off. Marked TEMPORARY in the comment — the proper upstream fix is to add DD_PROFILING_ENABLED to that same allowlist.
  • Add DD_INSTRUMENTATION_TELEMETRY_ENABLED=false. With the tracer module now loaded, the telemetry beforeExit handler fires a final HTTP request whose setup allocates thousands of small objects that dominated the heap snapshot — node_heap's objects/count profile was 98% telemetry stacks, and node_heap_oom's space percentage drifted just outside the ±3% margin (93% vs expected 97%).

Test plan

  • TEST_SCENARIOS='node_(heap|heap_oom|wall_cpu)$' go test -timeout 10m -v -run TestScenarios passes locally for all three scenarios
  • node_code_hotspots (unchanged) still passes
  • Verify in nightly CI run after merge

… 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.
@szegedi szegedi requested a review from a team as a code owner April 27, 2026 12:40
@szegedi szegedi merged commit dedff38 into main Apr 27, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants