✨ [RUM-16925] attach debug IDs from DD_SOURCE_CODE_CONTEXT to error and long task events#4812
Draft
amortemousque wants to merge 3 commits into
Draft
✨ [RUM-16925] attach debug IDs from DD_SOURCE_CODE_CONTEXT to error and long task events#4812amortemousque wants to merge 3 commits into
amortemousque wants to merge 3 commits into
Conversation
- Move sourceCodeContext from browser-rum-core to browser-core so all packages can access it - Rename MFE-specific context to sourceCodeMfeContext - Attach debug IDs (from DD_SOURCE_CODE_CONTEXT) to raw errors and long tasks via stack trace URL lookup Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- errors.scenario: verify _dd.debug_ids is populated on error events from DD_SOURCE_CODE_CONTEXT - microfrontend.scenario: verify _dd.debug_ids on MFE runtime errors and LOAf events Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Bundles Sizes Evolution
|
…uota_reason on profiling Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
0dc95c6 to
5fa0ed2
Compare
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
Part of the sourcemap unminification project. When a Datadog bundler plugin is used, it injects
DD_SOURCE_CODE_CONTEXTon the window with per-bundle metadata (service, version, debug ID). This PR makes the RUM SDK read theddDebugIdfield from that context and attach it to error and long task events as_dd.debug_ids, enabling the backend to correlate events with uploaded sourcemaps.Changes
sourceCodeContextfrombrowser-rum-coretobrowser-coreso both the error pipeline and the RUM assembly layer can access itsourceCodeMfeContext(clearer scope)computeRawError: resolvedebug_idsby looking up all stack frame URLs inDD_SOURCE_CODE_CONTEXTand attach them as_dd.debug_idson error eventslongTaskCollection: same lookup onscript.sourceURLfor Long Animation Frame eventsgetDebugIdsandgetSourceCodeContextfrom@datadog/browser-coreTest instructions
window.DD_SOURCE_CODE_CONTEXTwith a stack entry whose top-frame URL matches a script URL on the page and addDebugIdvalue_dd.debug_ids: { [scriptUrl]: debugId }The E2E tests cover both flows automatically (
yarn test:e2e -g "debug ID").Checklist