fix(telemetry): report non-instrumented ESM packages in dependency telemetry #10927
All Vouch review confidence checks passed
Residual risk 0.14 = Change Risk (0.36) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.36 · 191 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.315
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #10927"
general
weight: 0.35
bengl
What does this PR do?
Reports ESM packages that dd-trace does not instrument in the
app-dependencies-loadedtelemetry, without wrapping them.loader-hook.mjsreports the first loaded file of eachnode_modulespackage from itsload/loadSynchooks. The async loader sends reports to the application thread over aMessagePortpassed byregister.js; the sync loader publishes directly.dd-trace:moduleLoadStart, the channel dependency telemetry already listens to, asiitm.jsdid for every ESM module before #6455. Each one is closed right away ondd-trace:moduleLoadEnd, so consumers that pair both stay balanced. Reports are also kept, sotelemetry/dependencies.jsreplays the ones published before the tracer started.Motivation
Since #6455 (v5.75.0, v6.0.0), import-in-the-middle only wraps instrumented modules, so ESM-only packages without a dd-trace plugin (e.g.
axios >= 1,nanoid) never reach the Runtime SCA dependency inventory.Jira: APPSEC-62647
Additional Notes
| | Node.js 22.20 (async loader) | Node.js 26.11 (sync loader) |
|---|---|---|
| Graph loaded | 115.0 → 114.8 ms | 84.6 → 85.2 ms |
| Process wall time | 168.2 → 168.6 ms | 131.9 → 133.0 ms |
| Max RSS | 94.2 → 94.5 MB | 92.8 → 93.0 MB |