Skip to content

✨ [DEBUG-6328] Default the Live Debugger service to the build plugin's - #5148

Draft
watson wants to merge 3 commits into
mainfrom
watson/DEBUG-6328/default-service-from-build
Draft

watson wants to merge 3 commits into
mainfrom
watson/DEBUG-6328/default-service-from-build

Conversation

@watson

@watson watson commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

DEBUG-6328: default init().service to the service the Datadog build plugin injects into __DD_LIVE_DEBUGGER_BUILD__, the same way init().version already defaults to the build's version.

The build plugin uploads each build's function list (the symbol table) to Live Debugger under its shared metadata.service option. Live Debugger finds it by the service this SDK reports, so the two must match. Taking it from the build removes the risk of configuring it differently in two places. Build-plugins side: DataDog/build-plugins#593.

 init(initConfiguration)
+  service = initConfiguration.service ?? __DD_LIVE_DEBUGGER_BUILD__.service   # warn on mismatch
+  if (!service) display.error('"service" is required…'); return
   version = initConfiguration.version ?? __DD_LIVE_DEBUGGER_BUILD__.version   # unchanged
  • service becomes optional in DebuggerInitConfiguration, and DebuggerBuildMetadata gains service. Both only loosen the types.
  • Build metadata values that aren't non-empty strings are ignored, now for version too, like debugId already was.

Evidence

  • Before: init() without service started anyway and polled the Delivery API without a service.
    After: main.spec.ts, 21/21 (up from 10):
    • the service is taken from the build metadata;
    • an explicit init() service wins and warns on a mismatch;
    • invalid build metadata (missing, '', 123) is ignored;
    • with no service anywhere, init() logs an error and nothing starts.
  • yarn eslint packages/browser-debugger, yarn prettier --check packages/browser-debugger and yarn typecheck are clean.

Merge Danger

Door: two-way

Blast Radius: Browser Debugger SDK init()

  • A JavaScript caller that omits service, and runs on a build without the build plugin's service, now gets an error and no init instead of a broken one.
  • Ship together with, or after, Upload the Live Debugger symbol table to SymDB build-plugins#593 for the default to take effect. Until then, setting service in init() keeps working as before.

🤖 Generated with Claude Code

The Datadog build plugin uploads each build's function list to Live
Debugger under a service, and Live Debugger finds it by the service the
SDK reports, so both have to match. The build plugin now also writes its
service (`liveDebugger.service`) into `__DD_LIVE_DEBUGGER_BUILD__`.

Default `init().service` to that value, the same way `init().version`
already defaults to the build's version. An explicit `init()` value wins,
and a mismatch logs a warning. `service` becomes optional in the init
configuration type; without one from either place, `init()` logs an error
and doesn't start. Build metadata values that aren't non-empty strings
are ignored.

Environment: Datadog workspace

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

cit-pr-commenter-54b7da Bot commented Oct 16, 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-official

datadog-official Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Pipelines  Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
• Patch Coverage: 55.56%
• Overall Coverage: 77.27% (-0.00%)

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

watson and others added 2 commits October 16, 2026 09:01
The build plugin now takes the service from its shared top-level
`metadata.service` option instead of `liveDebugger.service`. Update the
error message, the type documentation and the README accordingly.

Environment: Datadog workspace

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

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