Skip to content

Default debugger version and embed build identity in snapshots#4511

Open
watson wants to merge 1 commit into
watson/DEBUG-5296/allow-no-args-or-localsfrom
watson/DEBUG-5465/use-build-version
Open

Default debugger version and embed build identity in snapshots#4511
watson wants to merge 1 commit into
watson/DEBUG-5296/allow-no-args-or-localsfrom
watson/DEBUG-5465/use-build-version

Conversation

@watson
Copy link
Copy Markdown
Collaborator

@watson watson commented Apr 21, 2026

Motivation

The Browser Debugger SDK should be able to pick up the browser build version injected by the Live Debugger build plugin so applications do not need to pass the same deployed build identifier into datadogDebugger.init() a second time.

The debugger snapshot payload also needs applicationId and version so downstream browser-build and source-resolution flows can identify the correct browser build when git tags are unavailable.

Changes

Version defaulting from build metadata

  • default datadogDebugger.init().version from the build-plugin metadata when callers omit version
  • keep an explicit init({ version }) value authoritative and warn if it disagrees with the injected build-plugin version
  • document that version is optional, but browser build lookup and source-aware resolution depend on an immutable deployed build identifier when available

Snapshot build identity

  • include applicationId and version as a structured build object inside the debugger.snapshot payload (debugger.snapshot.build = { applicationId, version })
  • this replaces the earlier approach of putting application_id as a top-level field and duplicating application_id/version into ddtags, which was vulnerable to tag collision from downstream enrichment
  • the build object rides on the existing @debugger.snapshot column projection, so the web UI reads it without any query changes

Version documentation

  • document that version is optional in the Browser Debugger README and API docs
  • clarify that when provided, version should be the immutable deployed browser build identifier
  • clarify graceful degradation when version is absent

Test instructions

Run:

yarn test:unit --spec packages/debugger/src/entries/main.spec.ts
yarn test:unit --spec packages/debugger/src/domain/api.spec.ts

Part of larger effort

This PR is one part of the browser Live Debugger source-resolution work across multiple repositories:

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

Copy link
Copy Markdown
Collaborator Author

watson commented Apr 21, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@cit-pr-commenter-54b7da
Copy link
Copy Markdown

cit-pr-commenter-54b7da Bot commented Apr 21, 2026

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum 169.51 KiB 169.51 KiB 0 B 0.00%
Rum Profiler 5.97 KiB 5.97 KiB 0 B 0.00%
Rum Recorder 21.23 KiB 21.23 KiB 0 B 0.00%
Logs 54.70 KiB 54.70 KiB 0 B 0.00%
Rum Slim 127.85 KiB 127.85 KiB 0 B 0.00%
Worker 22.99 KiB 22.99 KiB 0 B 0.00%
🚀 CPU Performance
Action Name Base CPU Time (ms) Local CPU Time (ms) 𝚫%
RUM - add global context 0.0019 0.0026 +36.84%
RUM - add action 0.0095 0.015 +57.89%
RUM - add error 0.0101 0.0124 +22.77%
RUM - add timing 0.0005 0.0007 +40.00%
RUM - start view 0.012 0.0116 -3.33%
RUM - start/stop session replay recording 0.0007 0.001 +42.86%
Logs - log message 0.0194 0.0193 -0.52%
🧠 Memory Performance
Action Name Base Memory Consumption Local Memory Consumption 𝚫
RUM - add global context 38.61 KiB 38.24 KiB -374 B
RUM - add action 64.97 KiB 64.34 KiB -646 B
RUM - add timing 37.33 KiB 38.78 KiB +1.45 KiB
RUM - add error 69.54 KiB 68.40 KiB -1.14 KiB
RUM - start/stop session replay recording 42.58 KiB 41.23 KiB -1.35 KiB
RUM - start view 483.21 KiB 483.70 KiB +505 B
Logs - log message 54.48 KiB 54.64 KiB +157 B

🔗 RealWorld

@datadog-prod-us1-4
Copy link
Copy Markdown

datadog-prod-us1-4 Bot commented Apr 21, 2026

Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

🎯 Code Coverage (details)
Patch Coverage: 84.62%
Overall Coverage: 77.05% (+0.09%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: cd05b6a | Docs | Datadog PR Page | Give us feedback!

@watson watson changed the base branch from watson/DEBUG-5296/add-live-debugger to graphite-base/4511 April 21, 2026 07:35
@watson watson force-pushed the watson/DEBUG-5465/use-build-version branch from 4c0a5c3 to bc690fe Compare April 21, 2026 07:39
@watson watson force-pushed the graphite-base/4511 branch from bf9a162 to b9da4f3 Compare April 21, 2026 07:39
@watson watson changed the base branch from graphite-base/4511 to watson/DEBUG-5296/add-live-debugger April 21, 2026 07:39
@watson watson changed the base branch from watson/DEBUG-5296/add-live-debugger to graphite-base/4511 April 21, 2026 08:17
@watson watson force-pushed the watson/DEBUG-5465/use-build-version branch from bc690fe to 44d9b67 Compare April 21, 2026 08:19
@watson watson force-pushed the graphite-base/4511 branch from b9da4f3 to 0040ee8 Compare April 21, 2026 08:19
@watson watson changed the base branch from graphite-base/4511 to watson/DEBUG-5296/add-live-debugger April 21, 2026 08:19
@watson watson changed the base branch from watson/DEBUG-5296/add-live-debugger to graphite-base/4511 April 21, 2026 09:12
@watson watson force-pushed the watson/DEBUG-5465/use-build-version branch from 44d9b67 to c3334a6 Compare April 21, 2026 09:14
@watson watson force-pushed the graphite-base/4511 branch from 0040ee8 to 653aee9 Compare April 21, 2026 09:14
@watson watson changed the base branch from graphite-base/4511 to watson/DEBUG-5296/add-live-debugger April 21, 2026 09:14
@watson watson changed the title Default debugger init version from build metadata Browser debugger identity: version defaulting and applicationId on snapshots Apr 22, 2026
@watson watson changed the title Browser debugger identity: version defaulting and applicationId on snapshots Add browser build identity to debugger snapshots Apr 22, 2026
@watson watson changed the base branch from watson/DEBUG-5296/add-live-debugger to graphite-base/4511 April 22, 2026 12:24
@watson watson force-pushed the watson/DEBUG-5465/use-build-version branch from cff6b3c to 1ffcdba Compare April 22, 2026 13:40
@watson watson changed the base branch from graphite-base/4511 to watson/DEBUG-5296/add-live-debugger April 22, 2026 13:40
@watson watson changed the title Add browser build identity to debugger snapshots Default debugger version from build metadata and tag snapshots with applicationId Apr 22, 2026
@watson watson changed the title Default debugger version from build metadata and tag snapshots with applicationId Default debugger version and tag snapshots with applicationId Apr 22, 2026
@watson watson force-pushed the watson/DEBUG-5465/use-build-version branch from 1ffcdba to 5259f76 Compare April 22, 2026 14:24
@watson watson force-pushed the watson/DEBUG-5296/add-live-debugger branch from 43903ba to 7d1efe7 Compare April 22, 2026 14:24
@watson watson changed the title Default debugger version and tag snapshots with applicationId Default debugger version and embed build identity in snapshots Apr 22, 2026
@watson watson changed the base branch from watson/DEBUG-5296/add-live-debugger to graphite-base/4511 April 23, 2026 10:42
@watson watson force-pushed the watson/DEBUG-5465/use-build-version branch from 7defb2b to 93ca4e3 Compare April 23, 2026 11:00
@watson watson changed the base branch from graphite-base/4511 to watson/DEBUG-5296/add-live-debugger April 23, 2026 11:00
@watson watson changed the base branch from watson/DEBUG-5296/add-live-debugger to graphite-base/4511 May 7, 2026 05:31
@watson watson force-pushed the watson/DEBUG-5465/use-build-version branch from 1ed65c3 to f05e4d1 Compare May 12, 2026 11:16
@watson watson force-pushed the graphite-base/4511 branch from 8130067 to 0bcb507 Compare May 12, 2026 11:16
@watson watson changed the base branch from graphite-base/4511 to watson/DEBUG-5296/allow-no-args-or-locals May 12, 2026 11:16
@watson watson force-pushed the watson/DEBUG-5296/allow-no-args-or-locals branch from 0bcb507 to 1eeda79 Compare May 12, 2026 11:43
@watson watson force-pushed the watson/DEBUG-5465/use-build-version branch 2 times, most recently from 077b2b1 to 1a6bded Compare May 12, 2026 14:15
Use build-plugin injected Live Debugger metadata as the default runtime
`init().version`, and warn when an explicit init version disagrees.
Document the fallback behavior and cover the new version resolution path
in unit tests.
@watson watson changed the base branch from watson/DEBUG-5296/allow-no-args-or-locals to graphite-base/4511 May 12, 2026 15:39
@watson watson force-pushed the watson/DEBUG-5465/use-build-version branch from 1a6bded to cd05b6a Compare May 13, 2026 05:07
@watson watson force-pushed the graphite-base/4511 branch from 13d0744 to 0a9836c Compare May 13, 2026 05:07
@watson watson changed the base branch from graphite-base/4511 to watson/DEBUG-5296/allow-no-args-or-locals May 13, 2026 05:07
@watson watson marked this pull request as ready for review May 13, 2026 05:08
@watson watson requested review from a team as code owners May 13, 2026 05:08
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.

2 participants