Repository navigation
Conversation
Contributor
|
|
🎉 All green!❄️ No new flaky tests detected 🔗 Commit SHA: 3d3ef41 | Docs | View more details | Give us feedback! |
watson
force-pushed
the
watson/DEBUG-5831/nodejs-snapshot-correlation
branch
from
October 7, 2026 19:43
9380af5 to
71810fd
Compare
watson
changed the base branch from
grantseltzer/correlation-tests-go
to
watson/correlation-tests-rebased-onto-main
October 7, 2026 19:45
watson
force-pushed
the
watson/DEBUG-5831/nodejs-snapshot-correlation
branch
from
October 8, 2026 02:17
497ee58 to
42f1063
Compare
Add the `/debugger/correlation` and `/debugger/correlation/loop/:count` endpoints to the Node.js Express, TypeScript Express and Fastify weblogs, mirroring the Go endpoints: the probed functions return 400ms apart, and the loop sleeps for a second per iteration. Node.js doesn't support method probes, so the correlation tests point each probe at the line its method returns on for Node.js instead, using new Node.js entries in the line map. The new routes move the capture timeout line from 157 to 159, and the budgets line from 163 to 165. Enable `Test_Debugger_Coordinated_Sampling` and `test_per_span_budget` from the dd-trace-js release that ships coordinated snapshot sampling (DataDog/dd-trace-js#10677). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Point the image mirror at the Node.js base images published for the new debugger fixtures. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The debugger scenarios run the Node.js weblogs with IAST enabled. The IAST rewriter rewrites any file that contains string concatenation, template literals or certain string methods, and Dynamic Instrumentation then places line probes in that file two lines too early. The template literals and `+=` in the new correlation endpoints made the rewriter rewrite all of `debugger/index.js`, which broke the line probes of the existing debugger tests too, e.g. the capture timeout probe paused inside the callback above its line. Write the endpoints without anything the rewriter instruments: respond with constant strings, and probe a plain assignment in the loop body, like the budgets fixture does. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Point the image mirror at the Node.js base images published for the debugger fixture fix. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
watson
force-pushed
the
watson/DEBUG-5831/nodejs-snapshot-correlation
branch
from
October 8, 2026 04:15
42f1063 to
3d3ef41
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Coordinated snapshot sampling for Node.js (DEBUG-5831, DataDog/dd-trace-js#10677) needs the snapshot correlation tests from #7425 to run for Node.js. Node.js only supports line probes, and the Node.js weblogs don't have the correlation endpoints yet.
Important
This PR builds on #7425, which adds the tests, probe files and line-map keys extended here. #7425's branch is far behind
main, so its CI fails on unrelated, outdated infrastructure: Debian security mirrors, the Go toolchain required by dd-trace-godev, andcapabilities.yml. So this PR's base iswatson/correlation-tests-rebased-onto-main: #7425's two commits rebased ontomain, with conflicts resolved by keepingmain's side and adding #7425's new entries, plus one fix on top: #7425'susing System.Runtime.CompilerServices;moved every line of the .NETDebuggerController.csdown by one, which broke all .NET line probes, so the base fully qualifies theMethodImplattributes instead. It also includes #7572's approved commit (accepting the flatdd.trace_idkey that .NET sends), which the .NET enablement in #7425 needs to pass. Once #7425 is updated or merged, this PR gets retargeted.Changes
/debugger/correlationand/debugger/correlation/loop/:countto the Node.js Express, TypeScript Express and Fastify weblogs, mirroring the Go endpoints:correlationLeaf,correlationMiddleandcorrelationreturn about 0, 400 and 800ms into the request, using real async sleeps, so trace context also crossesawaits.+,+=, template literals and some string methods) and respond with constant strings. The debugger scenarios run with IAST enabled, and when the rewriter rewrites a file, Dynamic Instrumentation places line probes in it two lines too early. An earlier revision used template literals, which broke the line probes of the existing debugger tests too.test_debugger_snapshot_correlation.py, both test classes read their probes through a small shared base class. For Node.js, it points each method probe at the line its method returns on, the same approach as the Node.js-only method-to-line conversions in the condition-error tests.Correlation(178),CorrelationMiddle(184),CorrelationLeaf(188),CorrelationLoopBody(194) andCorrelationLoopSibling(197). The new routes moveCaptureTimeoutfrom 157 to 159 andBudgetsfrom 163 to 165.manifests/nodejs.yml, enableTest_Debugger_Coordinated_Samplingandtest_per_span_budgetfrom>=6.21.0 || ^5.132.0, the next release, which should ship feat(debugger): coordinate snapshot sampling per trace dd-trace-js#10677. The twoTest_Debugger_Snapshot_Correlation_Fieldstests staymissing_feature. Theruntime_idone can be enabled once feat(debugger): include runtime_id in snapshot payloads dd-trace-js#10678 ships.base-images.lock.jsonand the Node.js entries of the image mirror files, because the fixture changes alter the express4, express4-typescript, express5 and fastify base-image hashes. The images are published.mainis also behind for the PHP base images updated in fix(php): profiling marker checks #7658. Those entries are left alone here.Testing
Docker wasn't available locally. Instead, the real
express/debugger/index.jsroutes ran under dd-trace-js with a fake agent, replaying both scenarios with the same probes (line probes on 178/184/188 at 1 snapshot/s, 30 sequential requests; loop probes with default sampling and/loop/3), with IAST enabled as in CI:/debugger/correlation×30/debugger/correlation/loop/3masterWarning
For Node.js,
Test_Debugger_Coordinated_Samplingpasses without coordinated sampling too. Each request takes nearly the same time (about 840ms), and every probe has the same 1 snapshot/s limit, so each probe sees the same time since its own last snapshot. Independent per-probe sampling then stays in lockstep and emits whole chains anyway. Making it discriminating would need the probes' sampling to drift apart, for example differentsnapshotsPerSecondper probe, or one probe also hit outside the chain. DataDog/dd-trace-js#10677's own integration test does the latter. I left that for the RFC owner to decide rather than changing the shared test here.test_per_span_budgetdoes discriminate.With IAST enabled and disabled, a snapshot probe on each mapped Node.js line (20, 159, 165, 178, 184, 188, 194 and 197) pauses on exactly that line.
Checks:
./format.sh --check: mypy, import policy, ruff, yamlfmt, yamllint, the manifest parser and shellcheck pass. The Node.js linter step needs Docker, so I ran ESLint from the Express and Fastify weblog setups directly on theirdebugger/index.js: both pass.express4-typescript/debugger/index.tstype-checks withtsc --strictagainst a minimal Express type stub, since the weblog's dependencies aren't installed locally.Expected CI failures:
test_db_integrations_sql.pyfails on thedevweblogs of several libraries. This is unrelated: Do not report irrelevant test to Test Optim #7987, which is based onmain, fails the same way.devweblogs with dd-trace-jsmaster, whose7.0.0-preversion already counts as>=6.21.0. Sotest_per_span_budgetfails ondevuntil the feature is onmaster. This is the documented flow for unmerged library changes indocs/edit/enable-test.md: enable the test for the next version, merge the library change, then re-run this PR.Before merging
Workflow
🚀 Once your PR is reviewed and the CI green, you can merge it!
🛟 #apm-shared-testing 🛟
Reviewer checklist
tests/ormanifests/is modified ? I have the approval from R&P teambuild-XXX-imagelabel is present🤖 Generated with Claude Code