feat(libdatadog): accept a borrowed transport agent - #259
Merged
Conversation
The exporter cancels its own requests on close but leaves the caller-owned agent alive.
Overall package sizeSelf size: 31.52 MB Dependency sizes| name | version | self size | total size | |------|---------|-----------|------------|🤖 This report was automatically generated by heaviest-objects-in-the-universe |
BridgeAR
marked this pull request as ready for review
September 4, 2026 16:19
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 17cb74fed7
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
BridgeAR
marked this pull request as draft
September 4, 2026 16:27
An unconditional Connection: close header prevents keep-alive agents from reusing sockets. The transport option also accepted objects without Node's required addRequest method, so invalid values failed on the first export.
BridgeAR
marked this pull request as ready for review
September 4, 2026 17:18
bengl
approved these changes
Sep 4, 2026
BridgeAR
added a commit
that referenced
this pull request
Sep 4, 2026
* feat(libdatadog): accept a borrowed transport agent The exporter cancels its own requests on close but leaves the caller-owned agent alive. * fix(libdatadog): honor borrowed transport agents An unconditional Connection: close header prevents keep-alive agents from reusing sockets. The transport option also accepted objects without Node's required addRequest method, so invalid values failed on the first export.
BridgeAR
added a commit
that referenced
this pull request
Sep 4, 2026
* feat(libdatadog): accept a borrowed transport agent The exporter cancels its own requests on close but leaves the caller-owned agent alive. * fix(libdatadog): honor borrowed transport agents An unconditional Connection: close header prevents keep-alive agents from reusing sockets. The transport option also accepted objects without Node's required addRequest method, so invalid values failed on the first export.
BridgeAR
added a commit
that referenced
this pull request
Sep 4, 2026
* fix(libdatadog): bound active agentless request buffers (#238) Agentless data-pipeline requests bypass the tracer active request budget, so a slow intake can retain unbounded request bodies. Preserve the 64 MiB process-wide bound and release bytes on completion or cancellation. (cherry picked from commit 380c8a6) * chore(deps): bump the patch-updates group across 1 directory with 2 updates (#212) Bumps the patch-updates group with 2 updates in the / directory: [futures](https://github.com/rust-lang/futures-rs) and [serde](https://github.com/serde-rs/serde). Updates `futures` from 0.3.32 to 0.3.34 - [Release notes](https://github.com/rust-lang/futures-rs/releases) - [Changelog](https://github.com/rust-lang/futures-rs/blob/main/CHANGELOG.md) - [Commits](rust-lang/futures-rs@0.3.32...0.3.34) Updates `serde` from 1.0.228 to 1.0.229 - [Release notes](https://github.com/serde-rs/serde/releases) - [Commits](serde-rs/serde@v1.0.228...v1.0.229) --- updated-dependencies: - dependency-name: futures dependency-version: 0.3.34 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: patch-updates - dependency-name: serde dependency-version: 1.0.229 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: patch-updates ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> (cherry picked from commit f9d55fb) * chore(deps-dev): bump eslint-plugin-n from 17.24.0 to 18.2.2 (#175) Bumps [eslint-plugin-n](https://github.com/eslint-community/eslint-plugin-n) from 17.24.0 to 18.2.2. - [Release notes](https://github.com/eslint-community/eslint-plugin-n/releases) - [Changelog](https://github.com/eslint-community/eslint-plugin-n/blob/master/CHANGELOG.md) - [Commits](eslint-community/eslint-plugin-n@v17.24.0...v18.2.2) --- updated-dependencies: - dependency-name: eslint-plugin-n dependency-version: 18.2.2 dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> (cherry picked from commit c13eeb3) * chore(deps-dev): bump the minor-updates group across 1 directory with 2 updates (#190) Bumps the minor-updates group with 2 updates in the / directory: [eslint](https://github.com/eslint/eslint) and [globals](https://github.com/sindresorhus/globals). Updates `eslint` from 10.6.0 to 10.9.1 - [Release notes](https://github.com/eslint/eslint/releases) - [Commits](eslint/eslint@v10.6.0...v10.9.1) Updates `globals` from 17.7.0 to 17.11.0 - [Release notes](https://github.com/sindresorhus/globals/releases) - [Commits](sindresorhus/globals@v17.7.0...v17.11.0) --- updated-dependencies: - dependency-name: eslint dependency-version: 10.8.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: minor-updates - dependency-name: globals dependency-version: 17.8.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: minor-updates ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> (cherry picked from commit fc69f10) * chore(deps): bump body-parser from 1.20.4 to 2.3.0 in /test/crashtracker (#140) Bumps [body-parser](https://github.com/expressjs/body-parser) from 1.20.4 to 2.3.0. - [Release notes](https://github.com/expressjs/body-parser/releases) - [Changelog](https://github.com/expressjs/body-parser/blob/master/HISTORY.md) - [Commits](expressjs/body-parser@1.20.4...v2.3.0) --- updated-dependencies: - dependency-name: body-parser dependency-version: 2.3.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> (cherry picked from commit c881997) * perf(capabilities): remove redundant HTTP buffer copies (#242) Across two fresh Node 22.23.2 / V8 12.4 processes, direct Buffer reuse reduced 46-byte response conversion from 20.9–21.0 ns to 6.1–6.2 ns. Parsing the existing request-head Buffer reduced 71.2–71.8 ns to 32.5–32.8 ns in the same seven-trial benchmark. (cherry picked from commit 12991d8) * chore(deps-dev): bump eslint-plugin-unicorn to 74 (#240) * chore(deps-dev): bump eslint-plugin-unicorn to 71.1.0 The updated recommended preset adds opinionated checks that conflict with Node 18 support and established runtime patterns. Keep its correctness checks enabled and align the deliberate exceptions with dd-trace-js. Refs: #162 * chore(deps-dev): update eslint-plugin-unicorn to 74.0.0 The latest recommended preset adds style and parsing diagnostics. Align the project exceptions with dd-trace-js and keep the remaining checks enabled. (cherry picked from commit 7bc0b3c) * refactor(libdatadog): use callbacks for agentless transport (#239) * refactor(libdatadog): use callbacks for agentless transport The public callback API still crossed Promise-based host and WASM boundaries, which left two completion models for each export. Rust keeps retry and cancellation ownership; the final callback preserves the caller's async context. Active-buffer admission completes as a local drop. A network error would retain the discarded payload through the Rust retry backoff. * refactor(libdatadog): leave export context to callers dd-trace enters every export inside its no-tracing context, so libdatadog does not need to restore caller context. (cherry picked from commit 6dd6ce9) * ci: reuse release proposal artifacts (#237) * ci: reuse release proposal artifacts Stable releases rebuild native and WASM artifacts after the proposal checks finish, so npm can receive binaries that CI did not test. Bind one candidate bundle to the merged Git tree and stop the release when that bundle is unavailable. Refs: #236 * ci: simplify release artifact lookup The release only needs proof that the proposal run tested the merged tree, because it downloads the immutable artifacts from that run. * ci: pin release candidate artifact The release workflow can start before the proposal artifacts exist. Reruns also retain the run ID, so separate name-based downloads can mix build attempts. A stable release must use one complete bundle that matches the tree and merged same-repository head. (cherry picked from commit 20ebef2) * chore(deps): upgrade napi-rs to v3 (#244) napi and napi-derive must use the same major. Updating either crate alone leaves generated bindings incompatible with the runtime API and breaks every native build. (cherry picked from commit 5998158) * fix(ci): resolve release artifacts by candidate tree (#246) Pull-request workflows can build from synthetic merge commits, so workflow_run.head_sha can differ from the PR source head. Filtering an already tree-qualified artifact by that SHA prevents stable releases from finding it. * fix(crashtracker): preserve cross-context exception metadata (#257) Errors created in another V8 context fail the main context's instanceof Error check, so uncaught exception reports lose their structured type, message, and stack frames. The Node-API check recognizes these errors, while the existing instanceof fallback preserves transparent proxy behavior. * chore: remove obsolete repository residue (#247) Root sketch and zstd checks became unreachable when their bindings moved to the universal package, which already tests both capabilities. The WASM matrix now uses the checksum-verified setup shared with the universal package. * refactor(process-discovery): accept metadata objects (#248) `dd-trace` still calls the positional `TracerMetadata` constructor, so a small factory preserves that contract while `storeMetadata` moves to plain objects. * bench(agentless): add end-to-end pipeline workloads (#250) Build the measured WASM artifact first and stop timing at the generated request callback so transport latency cannot hide transformation and compression costs. * perf(wasm): rebuild std with immediate-abort panics (#255) Setting panic=abort does not remove formatting and unwinding paths already compiled into the standard library. Pin the WASM-only nightly toolchain and rebuild std with immediate-abort panics while leaving native builds on stable Rust. With the same optimizer and source revision, the main artifact shrinks from 443,295 to 372,236 bytes (16.0%). The measurement reproduced across two clean builds. * fix(capabilities): reject incomplete HTTP responses (#249) An incomplete HTTP response emits 'aborted' without 'end', so the transport promise and its Remote Config poll remain pending. * feat(libdatadog): accept a borrowed transport agent (#259) * feat(libdatadog): accept a borrowed transport agent The exporter cancels its own requests on close but leaves the caller-owned agent alive. * fix(libdatadog): honor borrowed transport agents An unconditional Connection: close header prevents keep-alive agents from reusing sockets. The transport option also accepted objects without Node's required addRequest method, so invalid values failed on the first export. * v0.21.0 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
bengl
pushed a commit
that referenced
this pull request
Sep 4, 2026
* feat(libdatadog): accept a borrowed transport agent The exporter cancels its own requests on close but leaves the caller-owned agent alive. * fix(libdatadog): honor borrowed transport agents An unconditional Connection: close header prevents keep-alive agents from reusing sockets. The transport option also accepted objects without Node's required addRequest method, so invalid values failed on the first export.
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.
Agentless exporters can accept a borrowed Node.js HTTP agent through the transport options. The exporter cancels its requests on close but does not destroy the agent.