Skip to content

Default debugger version and embed build identity in snapshots#4511

Draft
watson wants to merge 6 commits intowatson/DEBUG-5296/add-live-debuggerfrom
watson/DEBUG-5465/use-build-version
Draft

Default debugger version and embed build identity in snapshots#4511
watson wants to merge 6 commits intowatson/DEBUG-5296/add-live-debuggerfrom
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 179.42 KiB 179.42 KiB 0 B 0.00%
Rum Profiler 6.16 KiB 6.16 KiB 0 B 0.00%
Rum Recorder 27.03 KiB 27.03 KiB 0 B 0.00%
Logs 56.80 KiB 56.80 KiB 0 B 0.00%
Rum Slim 135.26 KiB 135.26 KiB 0 B 0.00%
Worker 23.63 KiB 23.63 KiB 0 B 0.00%
🚀 CPU Performance
Action Name Base CPU Time (ms) Local CPU Time (ms) 𝚫%
RUM - add global context 0.00545 0.0128 +134.86%
RUM - add action 0.0161 0.0194 +20.50%
RUM - add error 0.013999999999999999 0.0228 +62.86%
RUM - add timing 0.00295 0.0041 +38.98%
RUM - start view 0.01405 0.0195 +38.79%
RUM - start/stop session replay recording 0.0009 0.0009 0.00%
Logs - log message 0.016900000000000002 0.02 +18.34%
🧠 Memory Performance
Action Name Base Memory Consumption Local Memory Consumption 𝚫
RUM - add global context 31.62 KiB 31.62 KiB -7 B
RUM - add action 98.83 KiB 116.63 KiB +17.80 KiB
RUM - add timing 32.04 KiB 31.75 KiB -292 B
RUM - add error 102.48 KiB 107.66 KiB +5.18 KiB
RUM - start/stop session replay recording 31.65 KiB 30.91 KiB -753 B
RUM - start view 492.03 KiB 494.29 KiB +2.26 KiB
Logs - log message 102.30 KiB 102.44 KiB +150 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: 76.76% (+0.06%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 1ed65c3 | 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 added 4 commits April 23, 2026 12:55
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.
Browser snapshots need to carry the RUM application identity so the
web UI can resolve source metadata via the browser-build lookup when
git tags are absent.
Clarify that browser debugger version is optional, but when provided it
should match the immutable deployed build identifier used for browser
build lookup and sourcemap resolution. This keeps the SDK contract
aligned with graceful degradation when no version is configured.
Move applicationId and version off ddtags onto a structured field at
debugger.snapshot.build so the web UI reads browser-build identity
from an unambiguous payload path instead of tags that can collide
with downstream enrichment. Drop the top-level application_id field
and the application_id/version ddtag entries that are now redundant.
@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
Preserve the build-version defaulting flow while removing the
applicationId-based snapshot build payload and docs/tests that described
that unshipped resolution path. This keeps browser snapshots keyed by
service plus version without introducing a separate structured build
identity.

Made-with: Cursor
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