Skip to content

✨ [DEBUG-6326] Match Live Debugger probes on where.functionId - #5146

Draft
watson wants to merge 2 commits into
mainfrom
watson/DEBUG-6326/match-probes-on-function-id
Draft

watson wants to merge 2 commits into
mainfrom
watson/DEBUG-6326/match-probes-on-function-id

Conversation

@watson

@watson watson commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

Warning

Do not merge yet. Once this ships, the SDK ignores every probe without where.functionId. Today no probe has one, so browser probes would stop firing. Merge only after these are deployed:

  • DEBUG-6325: dd-source accepts and delivers where.functionId
  • DEBUG-6329: the UI creates browser method probes from SymDB with where.functionId
  • DEBUG-6330: the live-debugger MCP does the same

Motivation

DEBUG-6326, part of DEBUG-6321.

The SDK matched a probe by rebuilding the build plugin's function ID from where.typeName + ';' + where.methodName. The UI and MCP compute those two fields themselves, and they often disagree with the plugin: arrow functions, anonymous functions, computed keys, compiled names, monorepo paths. When they disagree, the probe is accepted but never fires, with no error.

In the epic, the build plugin is the only thing that defines function IDs. The UI and MCP copy the ID from SymDB into where.functionId, and the SDK uses it as-is.

Changes

  • ProbeWhere gains a required functionId. addProbe keys activeProbes by where.functionId. The typeName;methodName concatenation and its anonymous-function TODO are removed.
  • The Delivery API poller ignores log probes without where.functionId. There is no fallback to the old key, as the epic agreed.
  • typeName and methodName stay optional display fields. They are still copied into the snapshot (logger.name/logger.method, debugger.snapshot.probe.location) and into the RUM action, unchanged.
  • Probes on anonymous functions (<path>;<anonymous>@<line>:<col>:<index>) now work, because the ID is never parsed.
  • Test fixtures, the e2e makeProbe helper and the performance test server now send where.functionId.

Test instructions

  • yarn test:unit --spec packages/browser-debugger/src/domain/probes.spec.ts
  • yarn test:unit --spec packages/browser-debugger/src/domain/deliveryApi.spec.ts
  • yarn test:unit --spec packages/browser-debugger/src/domain/api.spec.ts
  • yarn test:e2e -g "debugger"

New unit tests cover:

  • registering a probe under where.functionId, including an anonymous-function ID;
  • ignoring delivered log probes that have no where.functionId;
  • capturing a snapshot for a probe on an anonymous function.

Restoring the old key makes 9 tests fail.

Checklist

  • Tested locally
  • Tested on staging
  • Added unit tests for this change.
  • Added e2e/integration tests for this change.
  • Updated documentation and/or relevant AGENTS.md file

🤖 Generated with Claude Code

Key active probes by the opaque function ID the build plugin embeds in
each instrumented function, delivered as `where.functionId`, instead of
rebuilding it from `typeName;methodName`. Probes without
`where.functionId` are ignored. `typeName` and `methodName` remain
display fields for snapshot locations and RUM actions.

This lets probes target anonymous functions and any other function whose
name or path the UI and MCP can't reproduce.

Environment: Datadog workspace

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cit-pr-commenter-54b7da

cit-pr-commenter-54b7da Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum Salesforce 188.93 KiB 188.93 KiB 0 B 0.00% ✅
Rum 188.91 KiB 188.91 KiB 0 B 0.00% ✅
Rum Salesforce Profiler 8.35 KiB 8.35 KiB 0 B 0.00% ✅
Rum Profiler 8.35 KiB 8.35 KiB 0 B 0.00% ✅
Rum Salesforce Recorder 32.04 KiB 32.04 KiB 0 B 0.00% ✅
Rum Recorder 32.04 KiB 32.04 KiB 0 B 0.00% ✅
Logs 59.37 KiB 59.37 KiB 0 B 0.00% ✅
Rum Slim 146.52 KiB 146.52 KiB 0 B 0.00% ✅
Worker 22.96 KiB 22.96 KiB 0 B 0.00% ✅
Rum Shopify 219.35 KiB 219.35 KiB 0 B 0.00% ✅
Rum Shopify Profiler 8.35 KiB 8.35 KiB 0 B 0.00% ✅
Rum Shopify Recorder 4.85 KiB 4.85 KiB 0 B 0.00% ✅

@datadog-prod-us1-4

datadog-prod-us1-4 Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Pipelines  Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
• Patch Coverage: 100.00%
• Overall Coverage: 77.27% (+0.00%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 7f31c42 | Docs | View more details | Give us feedback!

This branch has not been deployed

No deployments
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.

1 participant