✨ [RUM-16985] Capture wasm module build_ids and enrich error events - #4920
Draft
ImaneLargou wants to merge 9 commits into
Draft
✨ [RUM-16985] Capture wasm module build_ids and enrich error events#4920ImaneLargou wants to merge 9 commits into
ImaneLargou wants to merge 9 commits into
Conversation
Intercepts WebAssembly.instantiate / instantiateStreaming at SDK
script-load time to record (url, build_id) per loaded module, including
lazily-loaded modules. On error capture, attaches error.wasm_modules[]
and sets source_type='browser+wasm' so the backend can dispatch wasm
symbolication.
- New wasmModules/wasmModuleTracking.ts: hooks all four WebAssembly
entry points; reads build_id via a minimal custom-section parser;
registry stays live for lazy module loads
- New wasmModules/wasmBinaryParser.ts: walks wasm binary sections,
extracts build_id custom section or falls back to external_debug_info
- errorCollection: populates error.wasm_modules[] and flips source_type
to 'browser+wasm' when any module is registered
- rawRumEvent.types: adds wasm_modules?: Array<{url, build_id}> to
RawRumErrorEvent
- main.ts: installs tracking synchronously at script-load time to close
the race window before DD_RUM.init()'s deferred microtask
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
All contributors have signed the CLA ✍️ ✅ |
🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: 420fdee | Docs | Datadog PR Page | Give us feedback! |
ImaneLargou
marked this pull request as ready for review
August 11, 2026 09:47
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Bundles Sizes Evolution
|
ImaneLargou
marked this pull request as draft
August 11, 2026 10:10
Author
|
I have read the CLA Document and I hereby sign the CLA |
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
Browser WebAssembly runtime errors currently lack the module metadata required for WASM symbolication.
This change identifies errors containing WebAssembly stack frames and reports the loaded WASM module URL and build ID. This allows the error-processing pipeline to distinguish ordinary browser errors from errors that should use WASM/DWARF symbolication.
Related upstream schema change: DataDog/rum-events-format#427
Changes
WebAssembly.instantiateWebAssembly.instantiateStreamingWebAssembly.compileWebAssembly.compileStreamingbuild_idcustom section, withexternal_debug_infoas a fallback.error.source_type: "browser+wasm"error.wasm_modules, containing the module URL and build ID.jsframes do not qualify an error as WASM.rum-events-formatschema change.Test instructions
Run the relevant unit tests:
Run the E2E scenario:
yarn test:e2e -g "send WebAssembly runtime errors with module metadata"The E2E test loads a real .wasm module using
WebAssembly.instantiateStreaming, triggers a runtime error, and verifies that both RUM and Logs events contain:{ "source_type": "browser+wasm", "wasm_modules": [ { "url": "<test module URL>", "build_id": "abcd" } ] }Checklist