Skip to content

Switch debugger delivery to public ClientTokenAuth endpoint#4480

Draft
watson wants to merge 1 commit intowatson/DEBUG-5296/add-live-debuggerfrom
watson/DEBUG-5296/use-public-api
Draft

Switch debugger delivery to public ClientTokenAuth endpoint#4480
watson wants to merge 1 commit intowatson/DEBUG-5296/add-live-debuggerfrom
watson/DEBUG-5296/use-public-api

Conversation

@watson
Copy link
Copy Markdown
Collaborator

@watson watson commented Apr 14, 2026

Motivation

Switch the debugger delivery API from the internal same-origin /api/ui/debugger/probe-delivery route (ValidUser session cookie auth) to the public /api/unstable/debugger/frontend/probes route (ClientTokenAuth). This is Stage 3 of the probe delivery redesign, enabling the browser SDK to fetch probes through the public Smart Edge route using the same RUM-style client token authentication model used by other Datadog frontend SDKs.

The backend route is already registered in debugger-delivery-api and allowlisted for ClientTokenAuth in Lambo.

Changes

packages/debugger/src/domain/deliveryApi.ts

  • Endpoint path changed from /api/ui/debugger/probe-delivery to /api/unstable/debugger/frontend/probes
  • Delivery URL is now constructed as https://api.{site}/... from the site config (defaults to datadoghq.com)
  • Authentication changed from credentials: 'same-origin' (session cookies) to a dd-client-token request header
  • Added proxy support: when set, the proxy origin replaces the computed API host (used by E2E tests and available for customer proxy setups)

packages/debugger/src/entries/main.ts

  • Added proxy?: string to DebuggerInitConfiguration
  • clientToken, site, and proxy are now forwarded to startDeliveryApiPolling

E2E test infrastructure

  • Delivery mock endpoint moved from the base mock server to the intake server (since formatConfiguration already sets proxy: servers.intake.origin for all SDK configs)
  • setDebuggerProbes moved from MockServerApp to IntakeServerApp
  • E2E scenarios updated to call servers.intake.app.setDebuggerProbes

Test instructions

Unit tests:

yarn test:unit --spec packages/debugger/src/domain/deliveryApi.spec.ts

All debugger unit tests:

yarn test:unit --spec "packages/debugger/src/**/*.spec.ts"

To verify on staging: initialize the debugger SDK with a valid clientToken and applicationId, confirm that delivery polling requests go to https://api.datad0g.com/api/unstable/debugger/frontend/probes with a dd-client-token header (visible in the Network tab).

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 14, 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.

@watson watson mentioned this pull request Apr 14, 2026
4 tasks
@cit-pr-commenter-54b7da
Copy link
Copy Markdown

cit-pr-commenter-54b7da Bot commented Apr 14, 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.0039 -28.44%
RUM - add action 0.0161 0.0128 -20.50%
RUM - add error 0.013999999999999999 0.012 -14.29%
RUM - add timing 0.00295 0.0033 +11.86%
RUM - start view 0.01405 0.012 -14.59%
RUM - start/stop session replay recording 0.0009 0.0008 -11.11%
Logs - log message 0.016900000000000002 0.0148 -12.43%
🧠 Memory Performance
Action Name Base Memory Consumption Local Memory Consumption 𝚫
RUM - add global context 31.53 KiB 31.12 KiB -425 B
RUM - add action 101.84 KiB 113.48 KiB +11.64 KiB
RUM - add timing 32.46 KiB 32.19 KiB -283 B
RUM - add error 104.34 KiB 111.38 KiB +7.04 KiB
RUM - start/stop session replay recording 32.01 KiB 31.35 KiB -667 B
RUM - start view 489.22 KiB 495.41 KiB +6.20 KiB
Logs - log message 99.21 KiB 92.75 KiB -6.46 KiB

🔗 RealWorld

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

datadog-prod-us1-3 Bot commented Apr 14, 2026

Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

🎯 Code Coverage (details)
Patch Coverage: 85.71%
Overall Coverage: 76.67% (-0.02%)

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

@watson watson force-pushed the watson/DEBUG-5296/use-public-api branch from 4d848e6 to 91efb95 Compare April 19, 2026 19:25
@watson watson changed the base branch from watson/DEBUG-5296/add-live-debugger to graphite-base/4480 April 21, 2026 07:35
@watson watson force-pushed the watson/DEBUG-5296/use-public-api branch from 91efb95 to fa1e260 Compare April 21, 2026 07:39
@watson watson force-pushed the graphite-base/4480 branch from bf9a162 to b9da4f3 Compare April 21, 2026 07:39
@watson watson changed the base branch from graphite-base/4480 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/4480 April 21, 2026 08:17
@watson watson force-pushed the watson/DEBUG-5296/use-public-api branch from fa1e260 to 56266cb Compare April 21, 2026 08:18
@watson watson force-pushed the graphite-base/4480 branch from b9da4f3 to 0040ee8 Compare April 21, 2026 08:18
@watson watson changed the base branch from graphite-base/4480 to watson/DEBUG-5296/add-live-debugger April 21, 2026 08:18
@watson watson changed the base branch from watson/DEBUG-5296/add-live-debugger to graphite-base/4480 April 21, 2026 09:12
@watson watson force-pushed the graphite-base/4480 branch from 0040ee8 to 653aee9 Compare April 21, 2026 09:13
@watson watson force-pushed the watson/DEBUG-5296/use-public-api branch from 56266cb to dc17ca7 Compare April 21, 2026 09:13
@watson watson changed the base branch from graphite-base/4480 to watson/DEBUG-5296/add-live-debugger April 21, 2026 09:13
@watson watson changed the base branch from watson/DEBUG-5296/add-live-debugger to graphite-base/4480 April 22, 2026 12:24
@watson watson force-pushed the watson/DEBUG-5296/use-public-api branch from dc17ca7 to 5e45077 Compare April 22, 2026 21:03
@watson watson force-pushed the graphite-base/4480 branch from 653aee9 to 7d1efe7 Compare April 22, 2026 21:03
@watson watson changed the base branch from graphite-base/4480 to watson/DEBUG-5296/add-live-debugger April 22, 2026 21:03
@watson watson changed the base branch from watson/DEBUG-5296/add-live-debugger to graphite-base/4480 April 23, 2026 10:42
Use the new POST /api/unstable/debugger/frontend/probes endpoint with
dd-client-token header authentication instead of the same-origin
/api/ui/debugger/probe-delivery route that relied on session cookies.

- Build delivery URL from site config (https://api.{site}/...)
- Authenticate via dd-client-token header instead of credentials: same-origin
- Add proxy config for routing delivery requests through a custom origin
- Move delivery mock from base server to intake server in E2E tests
@watson watson force-pushed the watson/DEBUG-5296/use-public-api branch from 5e45077 to 2498a01 Compare April 23, 2026 10:59
@watson watson changed the base branch from graphite-base/4480 to watson/DEBUG-5296/add-live-debugger April 23, 2026 10:59
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