fix(pipeline): set exporter runtime-id from the tracer#157
Merged
Conversation
Overall package sizeSelf size: 30.08 MB Dependency sizes| name | version | self size | total size | |------|---------|-----------|------------|🤖 This report was automatically generated by heaviest-objects-in-the-universe |
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 (a) gave the trace payload a random runtime-id that
mismatched the stats payload's (which already used the tracer's
runtime-id), and (b) called getrandom, trapping ("could not retrieve
random bytes for uuid" -> RuntimeError: unreachable) on wasm runtimes
without a configured entropy source. Pass through the runtime-id the
caller already provides.
5758cca to
2664938
Compare
ekump
approved these changes
Jul 2, 2026
Merged
bengl
added a commit
that referenced
this pull request
Jul 2, 2026
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.
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.
What
The
WasmSpanStateconstructor builds aTraceExporterBuilderand sets url/service/env/hostname/app_version, but never calledset_runtime_id. Theruntime_idpassed into the constructor was only used for the stats collector (StatsMeta), not the trace exporter. This PR passes that sameruntime_idto the exporter builder.Why
libdatadog's
TraceExporterBuilderdefaultsruntime_idtouuid::Uuid::new_v4()at build time (libdd-data-pipeline/src/trace_exporter/builder.rs). Withruntime_idunset, that default ran, which:getrandom, which panics (could not retrieve random bytes for uuid→RuntimeError: unreachable) on wasm runtimes without a configured entropy source. This surfaced as widespread failures in dd-trace-js System Tests / E2E: the pipeline trapped atbuild_async, so no spans were ever exported.Passing the runtime-id the caller already provides fixes both — the
unwrap_or_else(Uuid::new_v4)closure never runs (no getrandom call on the build path), and the trace/stats runtime-ids match.Test plan
node --test --test-force-exit test/pipeline.js→ 45/45node --test --test-force-exit test/http_transport.js→ 6/6Uuid::new_v4()code path, verified by review.Unblocks dd-trace-js #9139 (native-spans) System Tests / E2E.