Skip to content

chore: bump libdatadog - #203

Closed
Aaalibaba42 wants to merge 68 commits into
ishabi/v0.19.0-proposalfrom
jwiriath/bump-libdatadog-for-v0.19.0-proposal
Closed

chore: bump libdatadog#203
Aaalibaba42 wants to merge 68 commits into
ishabi/v0.19.0-proposalfrom
jwiriath/bump-libdatadog-for-v0.19.0-proposal

Conversation

@Aaalibaba42

Copy link
Copy Markdown
Contributor

No description provided.

rochdev and others added 30 commits September 3, 2024 16:14
* Handle wasm-pack's dash-to-underscore filename transformation

* Add a crate for wasm zstd implementation

* Only run tests for a single crate

* Fix WASM builds on macOS
* Upgrade to v26 and fix compat issues + serialization workaround

* Serde + napi demo

* remove demo code; keep commit for history

* clean up

* members being weird

* Remove crypto init and make test resilient

* Include pre-test script in build.yml

Add pre-test script to build workflow for artifact handling

* Remove crypto init

* Revert build yml file
* Align with how library filenames are generated in Cargo 1.79+

* Unrelated fix that makes our tests fail
* Add CODEOWNERS, with dd-trace-js and libdatadog teams
* bump libdd-crashtracker to v28

* v28.0.1
* Add unhandled exception libdatadog binding

* Use process.on() in the test

* uncaughtException -> uncaughtExceptionMonitor

* Handle unhandled promise rejections and add test scenarios

* We only need uncaughtExceptionMonitor

* Clean test cases

* Assert library
Replace the Node.js test runner (test.js) with scripts/test.sh so
tests are discovered and run from bash. The test script runs top-level
test/*.js files and index.js in test subdirectories, skipping wasm.
Call findWASM only when find() returns no native .node, so we skip
unnecessary prebuilds readdir when a native build is available.
When CC is set (e.g. ccache cc), the wasm32 C/C++ build can use Apple
Clang, which does not support wasm32-unknown-unknown, so the
datadog-js-zstd WASM build failed. Set CC_wasm32_unknown_unknown and
CXX_wasm32_unknown_unknown to Homebrew's clang so crates like zstd-sys
always use a wasm32-capable compiler.

Add DEVELOPMENT.md with Rust/rustup, macOS LLVM, and yarn setup steps,
and move the build/test notes from README into DEVELOPMENT.md.
…ping (#82)

Pin all GitHub Actions to full commit SHAs instead of version tags for
supply-chain safety. Add inline comments with the resolved version
(e.g. v4.3.1). Add Dependabot for github-actions (weekly), with a 5-day
cooldown (excluding @datadog/*) and a single grouped PR for action updates.
bengl and others added 20 commits July 1, 2026 13:37
…er) (#151)

* build: set up cargo workspace and wasm/native build tooling

Establish the Rust workspace, pin the toolchain, and add the npm scripts
and shell tooling that build the wasm modules and the native (napi)
addons and run their test suites.

Co-authored-by: Jules Wiriath <jules.wiriath@datadoghq.com>
Co-authored-by: paullegranddc <paul.legranddescloizeaux@datadoghq.com>
Co-authored-by: Gyuheon Oh <102937919+gyuheon0h@users.noreply.github.com>

* feat(capabilities): add wasm capability bundle

Implement the portable libdatadog capability traits for the wasm runtime:
an HTTP client backed by Node's http.request, a setTimeout-based sleep,
and a response-header observer hook. This bundle is the generic parameter
the data-pipeline and trace-exporter crates are instantiated with.

Co-authored-by: Jules Wiriath <jules.wiriath@datadoghq.com>
Co-authored-by: paullegranddc <paul.legranddescloizeaux@datadoghq.com>
Co-authored-by: Gyuheon Oh <102937919+gyuheon0h@users.noreply.github.com>

* feat(pipeline): add native-spans wasm pipeline

Wasm binding over libdatadog's span-id-addressed change buffer: span
creation and mutation via a binary op protocol, a deduplicated string
table, segment (trace-level) attributes, batched export through
prepareChunk/sendPreparedChunk, and optional client-side stats.

Co-authored-by: Jules Wiriath <jules.wiriath@datadoghq.com>
Co-authored-by: paullegranddc <paul.legranddescloizeaux@datadoghq.com>
Co-authored-by: Gyuheon Oh <102937919+gyuheon0h@users.noreply.github.com>

* feat(trace-exporter): add wasm TraceExporter binding

Expose libdatadog's TraceExporter to JS via wasm-bindgen, pinned to the
wasm capability bundle. The exporter is built lazily on first send, since
the blocking build path is unavailable on wasm. Includes an integration
test that drives it against an in-process mock agent.

Co-authored-by: Jules Wiriath <jules.wiriath@datadoghq.com>
Co-authored-by: paullegranddc <paul.legranddescloizeaux@datadoghq.com>
Co-authored-by: Gyuheon Oh <102937919+gyuheon0h@users.noreply.github.com>

* chore: adapt existing crates for toolchain and libdatadog bumps

Update library_config, process_discovery, and datadog-js-zstd for the
workspace's pinned Rust toolchain and libdatadog dependency versions.

Co-authored-by: Jules Wiriath <jules.wiriath@datadoghq.com>
Co-authored-by: paullegranddc <paul.legranddescloizeaux@datadoghq.com>
Co-authored-by: Gyuheon Oh <102937919+gyuheon0h@users.noreply.github.com>

* feat(pipeline): add meta_struct span bindings

libdatadog's Span already carries meta_struct (VecMap<Text, Bytes>) and
the exporter serializes it, but no JS binding existed, so structured
per-span data (AppSec, Code Origin, Dynamic Instrumentation) could not be
sent on the native path.

There is no change-buffer opcode for meta_struct, so setMetaStruct writes
the value directly onto the span via span_mut() after draining the change
queue. meta_struct depends on no other queued op, so bypassing the queue
ordering is safe \u2014 subsequent ops are applied on the next flush and never
touch meta_struct. getMetaStruct mirrors the existing per-span getters for
round-trip coverage.

* feat(capabilities): support unix socket and named-pipe agent transport

The wasm HTTP transport only spoke http/https to a host:port, so a
`unix://` or `windows:` agent URL could not be reached: request() treated
the hex-encoded socket path (ddcommon's parse_uri stores it in the URI
authority) as a TCP host.

Detect the unix/windows scheme in request(), hex-decode the socket path
from the authority, and pass it to the JS transport, which now uses
Node's { socketPath } (covering Windows named pipes too). TCP requests
are unchanged; socket requests send a localhost Host header with no port.
Adds a unix-socket case to the transport tests.

* feat(pipeline): add span_events bindings

Add `addSpanEvent` to append OpenTelemetry-style span events onto the
top-level v0.4 `span_events` field that libdatadog already serializes.
Like meta_struct there is no change-buffer opcode, so the event is
appended directly to the span after draining the queue (span_events do
not depend on any other queued op, so bypassing queue ordering is safe).

Attributes arrive as a flat little-endian buffer with per-value type
tags (String=0, Boolean=1, Integer=2, Double=3, Array=4) matching
libdatadog's AttributeArrayValue discriminants; every read is bounded
against the buffer so a malformed/truncated buffer errors instead of
panicking. A `getSpanEventsJson` helper serializes events via the same
serde impl used for the msgpack wire format, exercised by new
round-trip tests covering each scalar type, arrays, and bounds.

* feat(pipeline): add v0.5 output format selection

Add setUseV05() to WasmSpanState so the single trace exporter can emit the
v0.5 wire format (/v0.5/traces) instead of the default v0.4. The flag is read
once, at the lazy exporter build on first send, then fixed; callers must set
it before the first flush.

v0.5 uses a fixed 12-field schema with no slots for meta_struct, span_events,
or span_links, so libdatadog's v0.5 serializer silently drops them. This
mirrors dd-trace-js master's v0.5 encoder and is intentional \u2014 there is no
guard and no dual exporter. libdatadog does not downgrade V05 (unlike V1), so
the caller (dd-trace-js) is responsible for only enabling this after the agent
advertises /v0.5/traces via /info.

* chore: remove unused trace_exporter crate

The pipeline crate's WasmSpanState builds its own internal TraceExporter and
owns serialization + send (sendPreparedChunk), superseding the standalone
trace_exporter binding (JsTraceExporter, the earlier pre-encoded-v0.4-bytes
path). Nothing consumes it: dd-trace-js (native-spans and master) loads only
the pipeline crate, and no other tracked code references it. Drop the crate,
its wasm test, and the build/test wiring.

* build: restore wasm-pack install in build-wasm

The branch's build-wasm dropped the leading `yarn -s install-wasm-pack`
that main still runs, so a clean checkout without wasm-pack on PATH fails
with `wasm-pack: not found` before building any module. Restore it.

* fix(pipeline): keep stats collector available during in-flight flush

flushStats() took the StatsCollector out of its RefCell for the whole
async send, so a prepareChunk() during that await saw None and skipped
add_spans — permanently dropping those successfully-sent spans from
client-side stats. Split StatsCollector::flush into a synchronous
prepare_request (drain + encode under a brief borrow) and an async
send_request (no borrow). flushStats now builds the request, releases the
collector, then awaits the send, so concurrent add_spans is counted.

* refactor(capabilities): track libdatadog main and use a capability bundle struct

Bump the libdatadog branch=main git deps from the older pinned commit
(4b79b7ed) to the current main HEAD (a38b6304). Current main requires the
capability generic to implement LogWriterCapability in addition to
HttpClientCapability and SleepCapability.

Replace the `WasmCapabilities = DefaultHttpClient` type alias with a proper
bundle struct that mirrors libdatadog's native `NativeCapabilities { http,
sleep }`:

- rename `DefaultHttpClient` to `WasmHttpClient` (HTTP only) and move the
  sleep impl into its own `WasmSleepCapability` (new `sleep` module),
  matching libdatadog's `NativeHttpClient` / `NativeSleepCapability` split.
- `WasmCapabilities` now delegates HTTP and sleep to those fields and
  implements `LogWriterCapability` as a no-op, since the wasm binding only
  runs in trace-export mode.

Also pass the new `override_max_entries_per_bucket` argument (None = default)
to `SpanConcentrator::new`, which gained a parameter on main.

* feat(pipeline): add OTLP trace export config to the wasm binding

libdatadog's TraceExporter can export traces over OTLP HTTP (JSON or
protobuf) instead of to the Datadog agent, mapping its internal traces to
OTLP directly. Expose that on WasmSpanState so dd-trace-js can honour
OTEL_TRACES_EXPORTER=otlp without resurrecting a JS-side OTLP exporter.

- setOtlpEndpoint(url): route export to an OTLP HTTP endpoint (e.g. an OTel
  Collector) instead of the agent.
- setOtlpProtocol('http/json'|'http/protobuf'): select the wire format;
  rejects unsupported values (grpc) at the parse boundary.
- setOtlpHeaders([k, v, ...]): extra headers (e.g. collector auth).

All three apply at lazy build time and only when an OTLP endpoint is set.

* test(pipeline): strengthen OTLP coverage and document header pairing

Address review-until-green feedback on the OTLP binding:
- Pin the default wire protocol: the endpoint-only OTLP test now asserts the
  request content-type is JSON (the http/json default) instead of accepting
  either json or protobuf.
- Cover multi-header export and the odd-length trailing-drop in one test (two
  header pairs plus a stray unpaired element; assert both pairs arrive).
- Document that setOtlpHeaders ignores a trailing unpaired element, replaces
  prior headers, and that setOtlpEndpoint takes precedence over setUseV05.

* ci: build/test the pipeline wasm crate and fix test-suite lint

The pipeline crate is wasm-only, but it was missing from the build-test-wasm
matrix, so its wasm module was never built in CI (nor shipped in releases),
and the native action-prebuildify test matrix crashed on
`require('..').maybeLoad('pipeline')` returning undefined.

- Add `pipeline` to the build-test-wasm matrix in build.yml and release.yml,
  and make the composite action's test step crate-aware: pipeline runs its
  top-level node:test suites with --test-force-exit, other crates keep using
  test-wasm.js. This builds + tests the pipeline wasm in CI and includes it in
  release prebuilds.
- test/pipeline.js now skips its suite when the wasm binding is unavailable
  (the native test matrix) instead of throwing on the destructure.
- eslint: add test-file overrides (the node:test runner, the snake_case
  http_transport.js name that must match the Rust wasm_bindgen module path,
  null inputs in the wasm test harness, and describe-scoped test helpers) and
  mechanical cleanups so `eslint .` passes across the new test files + shim.
- Cargo.lock: canonicalize the dual-source libdd-trace-protobuf entry left
  inconsistent by the earlier rebase merge (no dependency changes).

* fix(capabilities): unref the wasm transport sleep timer so the host can exit

The wasm exporter races a sleep(timeout) against each HTTP request as a timeout
guard (and reuses it for retry backoff). On a fast success the timer is
abandoned but, being reffed, kept the Node process alive for up to the request
timeout (5 minutes) after the last flush. unref the timer: an in-flight request
refs the event loop on its own, so an abandoned/standalone timeout timer must
not block process exit.

This also fixes the Node 18 CI test jobs: scripts/test.sh now probes for
--test-force-exit (Node >= 20.14/22) and runs without it on Node 18, which
rejects the flag as unknown. With the unref above, node:test exits cleanly on
Node 18 regardless.

* ci: skip pipeline.js on Node 18 in the native test matrix

Node 18 lacks --test-force-exit (the wasm exporter keeps the event loop alive
after a flush) and the wasm HTTP client leaves a mock-agent socket open that
node:test cannot drain there, so test/pipeline.js cannot exit cleanly on Node
18. Skip it on a Node without --test-force-exit. The pipeline wasm is fully
covered by the build-test-wasm job and the Node 20/22/24/26 runs here, so this
loses no real coverage (it is platform/Node-independent wasm).

* fix(pipeline): harden buffer reads, build-error handling, and panics

Address review feedback on the wasm binding:
- get_num now bounds-checks internally and returns Option, so a truncated or
  malformed buffer yields a clean error at the call site instead of a panic
  (the check no longer relies on every call site). All five callers propagate it.
- Latch a failed lazy build_async: building is one-shot and a build failure is
  fatal (bad config), so once it fails every send returns a distinguishable
  NativeExporterBuildError (a tagged JS Error) instead of a misleading
  'exporter builder already consumed' string, letting the host stop retrying.
- Avoid panicking unwrap()s: the response builder's headers_mut() (which could
  panic on an out-of-range agent status) is handled gracefully; the
  provably-safe unwraps (Vec::as_mut_ptr, Reflect::set on a fresh object)
  become documented expects.

* chore(deps): pin libdatadog to the v37.0.0 release instead of branch=main

v37.0.0 includes everything the wasm pipeline needs \u2014 the libdd-capabilities
crate (with LogWriterCapability), the change-buffer feature, the
capability-bundle TraceExporter, and the OTLP builder methods \u2014 so pin the
released tag instead of tracking a moving main branch. This makes the build
reproducible and is a prerequisite for publishing the npm package.

SpanConcentrator::new gained a 5th argument (override_max_entries_per_bucket)
on a later main commit that is not in v37.0.0; drop it and use the 4-arg form
(we were passing its default, so behavior is unchanged).

* chore(pipeline): address review \u2014 release profile, unused deps/methods, docs

Address szegedi's review on the wasm binding:
- Restore the release profile to strip=true and drop debug=true (a debugging
  leftover; matters for the published package size, and matches main). With
  stripping restored, pass --all-features to wasm-opt for the pipeline crate
  ([package.metadata.wasm-pack]): its post-MVP features (bulk-memory for the
  change-buffer copies, sign-extension, etc.) otherwise trip wasm-pack's
  bundled wasm-opt validation (the smaller wasm crates don't hit this).
- Remove the unused @napi-rs/cli runtime dependency \u2014 nothing invokes it and
  main builds the native prebuilds without it.
- Remove the unused StatsCollector::flush and set_agent_url methods (dead since
  flush was split into prepare_request/send_request); clears the dead_code warning.
- Fix the prepareChunk error message (was mislabeled sendPreparedChunk) and the
  parse_response_headers doc (it takes a flat [name, value, ...] array, not an
  object).
- Document why the WASM_MEMORY LazyLock<JsValue> is Sync (wasm32-only).

---------

Co-authored-by: Jules Wiriath <jules.wiriath@datadoghq.com>
Co-authored-by: paullegranddc <paul.legranddescloizeaux@datadoghq.com>
Co-authored-by: Gyuheon Oh <102937919+gyuheon0h@users.noreply.github.com>
…sions (#150)

The build-test-wasm composite action still pinned the old Node.js 20 era
actions/* versions while the rest of the repo had moved on. Bring it in
line: actions/checkout v6.0.2, actions/download-artifact v8.0.1,
actions/setup-node v6.3.0, actions/upload-artifact v7.0.1.
* Expose ThreadLocalMetadata via process_discovery

Replaces the flat `threadlocal_attribute_keys` field on the napi
TracerMetadata with a `threadlocal_metadata` substruct mirroring the
libdatadog Rust API. Lets callers set the schema-version string and
extra process-context attributes (strings and 64-bit ints for now)
alongside the attribute key map.

libdd-library-config and libdd-trace-protobuf are pinned to the merge
commit that introduced the new API (7cdeb7896e92d1ba38bde495934e112dac2eda25);
swap back to a tagged release once one that includes it is published.

This is a breaking change to the process_discovery.TracerMetadata
constructor. Downstream (dd-trace-js) will need to migrate from passing
threadlocalAttributeKeys directly to passing a threadlocalMetadata
object.
The TraceExporterBuilder set url/service/env/hostname/app_version but
never called set_runtime_id, so at build_async the builder fell back to
Uuid::new_v4(). That gave the trace payload a random runtime-id that
mismatched the stats payload (correlation bug) and called getrandom,
which traps on wasm runtimes without a configured entropy source
(surfaced as native-spans System Tests / E2E failures). Pass through the
runtime-id the caller already provides.
…th 3 updates (#139)

Bumps the gh-actions-packages group with 3 updates in the / directory: [actions/checkout](https://github.com/actions/checkout), [actions/setup-node](https://github.com/actions/setup-node) and [DataDog/dd-octo-sts-action](https://github.com/datadog/dd-octo-sts-action).


Updates `actions/checkout` from 6.0.2 to 7.0.0
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@de0fac2...9c091bb)

Updates `actions/setup-node` from 6.3.0 to 6.4.0
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](actions/setup-node@53b8394...48b55a0)

Updates `DataDog/dd-octo-sts-action` from 1.0.3 to 1.0.4
- [Release notes](https://github.com/datadog/dd-octo-sts-action/releases)
- [Commits](DataDog/dd-octo-sts-action@acaa02e...96a2546)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 7.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: gh-actions-packages
- dependency-name: actions/setup-node
  dependency-version: 6.4.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: gh-actions-packages
- dependency-name: DataDog/dd-octo-sts-action
  dependency-version: 1.0.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: gh-actions-packages
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [libdd-crashtracker](https://github.com/DataDog/libdatadog) from v35.0.0 to v37.0.0.
- [Release notes](https://github.com/DataDog/libdatadog/releases)
- [Commits](DataDog/libdatadog@aa78483...86b7f57)

---
updated-dependencies:
- dependency-name: libdd-crashtracker
  dependency-version: b2a83ff19a2f4760d180bd9eb9e91f41566ba5b9
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
… 3 updates (#142)

Bumps the minor-updates group with 3 updates in the / directory: [eslint](https://github.com/eslint/eslint), [eslint-plugin-import-x](https://github.com/un-ts/eslint-plugin-import-x) and [globals](https://github.com/sindresorhus/globals).


Updates `eslint` from 10.0.3 to 10.6.0
- [Release notes](https://github.com/eslint/eslint/releases)
- [Commits](eslint/eslint@v10.0.3...v10.6.0)

Updates `eslint-plugin-import-x` from 4.16.2 to 4.17.1
- [Release notes](https://github.com/un-ts/eslint-plugin-import-x/releases)
- [Changelog](https://github.com/un-ts/eslint-plugin-import-x/blob/master/CHANGELOG.md)
- [Commits](un-ts/eslint-plugin-import-x@v4.16.2...v4.17.1)

Updates `globals` from 17.4.0 to 17.7.0
- [Release notes](https://github.com/sindresorhus/globals/releases)
- [Commits](sindresorhus/globals@v17.4.0...v17.7.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-version: 10.5.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: minor-updates
- dependency-name: eslint-plugin-import-x
  dependency-version: 4.17.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: minor-updates
- dependency-name: globals
  dependency-version: 17.7.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>
…141)

Bumps [express](https://github.com/expressjs/express) from 4.22.1 to 5.2.1.
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/master/History.md)
- [Commits](expressjs/express@v4.22.1...v5.2.1)

---
updated-dependencies:
- dependency-name: express
  dependency-version: 5.2.1
  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>
Co-authored-by: gh-worker-campaigns-3e9aa4[bot] <244854796+gh-worker-campaigns-3e9aa4[bot]@users.noreply.github.com>
prepareChunk overwrote the single prepared chunk on each call, so a flush
carrying spans from multiple traces could only send the last one. Callers
worked around that by passing every span to one prepareChunk, which lumps
distinct trace_ids into a single chunk: flush_chunk then treats them as one
segment and stamps trace-level tags (sampling priority, _dd.p.dm, origin,
top_level) onto only the first span, corrupting sampling and grouping under
load.

Stage chunks in a Vec instead: prepareChunk pushes one chunk per call and
sendPreparedChunk sends them all as a single multi-trace request. The exporter
calls prepareChunk once per trace, so each chunk is one segment with correct
per-trace tags. send_trace_chunks_async already accepts multiple chunks, so the
request shape is unchanged.
Add a `client_computed_stats` parameter to `WasmSpanState::new` and set
`builder.set_client_computed_stats()` so the exporter sends the
`Datadog-Client-Computed-Stats: true` header. The tracer needs this when it
runs in APM-standalone (apmTracingEnabled=false) so the agent skips its own APM
stats/sampling.

The header is also sent whenever `stats_enabled` is set: computing stats
client-side requires telling the agent to skip its own, otherwise the same
traces are counted twice. Enabling stats therefore always implies the header,
so the flags are OR'd in the binding rather than relying on the caller to keep
them in sync.

libdatadog's TraceExporterBuilder already supports the flag; the WASM binding
just never called it. Adds pipeline tests asserting the header is present when
client_computed_stats OR stats_enabled is set, and absent when both are off.
#166)

libdatadog's automatic entity detection (libdd-common's entity_id module) is
gated #[cfg(unix)] and therefore inert on the wasm32 target, and DD_EXTERNAL_ENV
is unreachable from wasm, so the native exporter never sent Datadog-Container-ID
/ Datadog-Entity-ID / Datadog-External-Env. Node can read /proc and process.env,
so detect them in the HTTP transport and rewrite the Rust-rendered request head
to carry them — the headers native libdatadog adds via set_standard_headers.

Detection mirrors dd-trace-js's exporters/common/docker.js (the proven legacy
exporter path) and libdd-common's compute_entity_id (ci-<container_id> else
in-<cgroup_inode>). The empty datadog-container-id libdatadog emits on wasm is
replaced rather than duplicated, and external-env is rejected if it carries
CR/LF or non-ASCII to avoid header injection.
…stats slash, IPv6 host

Four native-spans compatibility fixes for the dd-trace-js native (WASM) pipeline:

- Stamp span-meta language as javascript (not the nodejs tracer lang), matching the JS pipeline and system-tests test_meta_language_tag.
- Lazy-require node:http/node:https/node:fs in the transport so loading it during dd-trace-js init doesn't instrument builtins for a user ESM app under --require.
- Trim the trailing slash from the /v0.6/stats URL (was //v0.6/stats, which the agent/stats tooling missed), fixing client-stats delivery.
- Strip IPv6 brackets from the transport connect host ([::1] -> ::1) so traces reach an IPv6 agent.
Two native-spans fixes for the dd-trace-js native pipeline:

- Transport: parse the Rust-rendered HTTP/1.1 request head into {method, path, headers} for http.request() instead of injecting it via the Node-internal req._header, which Bun's node:http ignores (trace requests went out as POST / and were dropped). Verified on both Node and Bun.
- Client stats: build the /v0.6/stats URI via libdd_common::parse_uri (like the trace exporter) so a unix:// agent URL's socket path is hex-encoded into the URI authority and the request routes over the socket, instead of never reaching a UDS agent.
* fix(pipeline): set OTLP instrumentation scope

* fix(pipeline): consume ported libdatadog scope patch

Update the temporary libdatadog dependency to the PR head ported onto main. Current libdatadog also changed the stats concentrator API, so adapt the WASM stats wrapper to pass the new cardinality limit argument and encode unobfuscated buckets from FlushResult.

* fix(pipeline): return collapsed stats count from flushStats

* test(pipeline): widen stats overflow regression
* feat: added file capability

* fix: JS tomfoolery

* chore: change input to main now that libdatadog's side was merged

* fix: post bump fixes

* fix: review

* fix: address comments

* fix: detached buffer thing

* fix: transport for files renamed, uniform lazy loading
* feat: added env capability

* feat: respect envcapabilities method unsafedness

* feat: validate before saying it's ok

* revert: remove set/unset since they would be dangerous APIs in libdatadog (and are most likely not useful in the near/middel future in dd-trace-js)

* chore: change input to main's commit that has the change

* docs: update doc to remove specific references to the capabilities

* fix: remove extra checks

* fix: cache env beforehand
* feat: add DDSketch WASM bindings
* feat: added env capability

* feat: respect envcapabilities method unsafedness

* feat: validate before saying it's ok

* revert: remove set/unset since they would be dangerous APIs in libdatadog (and are most likely not useful in the near/middel future in dd-trace-js)

* chore: change input to main's commit that has the change

* docs: update doc to remove specific references to the capabilities

* fix: remove extra checks

* fix: cache env beforehand

* feat: Adopt TraceExporter's Telemetry stuff

* docs: fix libdatadog's behavior when 0 is passed

* chore: js tomfoolery

* fix: comments

* fix: use Cells uniformaly

* feat: make the losslessness obvious
@Aaalibaba42
Aaalibaba42 marked this pull request as ready for review August 17, 2026 20:49
@Aaalibaba42
Aaalibaba42 requested review from a team as code owners August 17, 2026 20:49
@Aaalibaba42
Aaalibaba42 requested a review from IlyasShabi August 17, 2026 20:49

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6d91dda39b

ℹ️ 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".

Comment on lines +62 to +64
fn new_without_connection_pooling() -> Self {
Self
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Honor the no-pooling constructor

When the bumped libdatadog calls new_without_connection_pooling(), this returns the same zero-sized client as new_client(), and http_transport.js subsequently calls transport.request() without an agent, so supported Node versions with keep-alive enabled still use the pooling global agent. Requests that explicitly require an isolated connection can therefore reuse a stale or shared socket; preserve a no-pooling mode on the client and pass it through to the JS transport (for example by using agent: false).

Useful? React with 👍 / 👎.

@github-actions

Copy link
Copy Markdown

Overall package size

Self size: 30.5 MB
Deduped: 30.5 MB
No deduping: 30.5 MB

Dependency sizes | name | version | self size | total size | |------|---------|-----------|------------|

🤖 This report was automatically generated by heaviest-objects-in-the-universe

@Aaalibaba42
Aaalibaba42 force-pushed the jwiriath/bump-libdatadog-for-v0.19.0-proposal branch from 6d91dda to 278bdf3 Compare August 18, 2026 08:15
@Aaalibaba42

Copy link
Copy Markdown
Contributor Author

Replaced by #206

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.