Skip to content

Switch debugger delivery to public ClientTokenAuth endpoint#4480

Open
watson wants to merge 1 commit into
mainfrom
watson/DEBUG-5296/use-public-api
Open

Switch debugger delivery to public ClientTokenAuth endpoint#4480
watson wants to merge 1 commit into
mainfrom
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

@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 169.36 KiB 169.36 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.69 KiB 127.69 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.0026 0.0021 -19.23%
RUM - add action 0.0127 0.0128 +0.79%
RUM - add error 0.0166 0.0118 -28.92%
RUM - add timing 0.0006 0.0007 +16.67%
RUM - start view 0.0144 0.0126 -12.50%
RUM - start/stop session replay recording 0.0012 0.001 -16.67%
Logs - log message 0.0268 0.017 -36.57%
🧠 Memory Performance
Action Name Base Memory Consumption Local Memory Consumption 𝚫
RUM - add global context 38.44 KiB 38.01 KiB -439 B
RUM - add action 69.11 KiB 68.04 KiB -1.07 KiB
RUM - add timing 36.85 KiB 36.85 KiB +2 B
RUM - add error 69.34 KiB 68.94 KiB -411 B
RUM - start/stop session replay recording 41.08 KiB 41.15 KiB +75 B
RUM - start view 484.32 KiB 459.22 KiB -25.10 KiB
Logs - log message 54.85 KiB 54.61 KiB -252 B

🔗 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: 75.00%
Overall Coverage: 77.05% (-0.01%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 239ef70 | 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
@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
@watson watson changed the base branch from watson/DEBUG-5296/add-live-debugger to graphite-base/4480 May 7, 2026 05:30
@watson watson force-pushed the graphite-base/4480 branch from 8130067 to e739e7e Compare May 12, 2026 09:13
@watson watson force-pushed the watson/DEBUG-5296/use-public-api branch from 2498a01 to 7c29372 Compare May 12, 2026 09:13
@watson watson changed the base branch from graphite-base/4480 to main May 12, 2026 09:13
@watson watson marked this pull request as ready for review May 12, 2026 09:14
@watson watson requested a review from a team as a code owner May 12, 2026 09:14
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7c2937253d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/debugger/src/domain/deliveryApi.ts
@watson watson force-pushed the watson/DEBUG-5296/use-public-api branch from 7c29372 to 331c32c Compare May 12, 2026 11:43
@watson watson requested a review from a team as a code owner May 12, 2026 11:43
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants