Skip to content

feat: Support proxy for debugger endpoint v2#918

Merged
lym953 merged 3 commits into
mainfrom
yiming.luo/debugger-proxy
Nov 24, 2025
Merged

feat: Support proxy for debugger endpoint v2#918
lym953 merged 3 commits into
mainfrom
yiming.luo/debugger-proxy

Conversation

@lym953

@lym953 lym953 commented Nov 10, 2025

Copy link
Copy Markdown
Contributor

Now we support proxying requests from /debugger/v1/input. This PR adds /debugger/v2/input and /debugger/v1/diagnostics.

#925

Test

Steps

  1. Set up Exception Replay following https://docs.datadoghq.com/error_tracking/backend/exception_replay/
  2. Build a test layer and install it on the Lambda
  3. Set DD_TRACE_DEBUG to true
  4. Change Lambda timeout from 3s to 30s. Seems Exception Replay dramatically increases the duration of the first invocation. It took 8–9s for my tests.

Result

Before:

  • In CloudWatch logs, see the error multiple times: debugger::unsupported_agentUnsupported Datadog agent detected. Snapshots from Dynamic Instrumentation/Exception Replay/Code Origin for Spans will not be uploaded. Please upgrade to version 7.49.0 or later

After:

  • No such error.
  • See tracer debug log: Detected /debugger/v2/input endpoint
  • See the error on Error Tracking page
image

Notes

Thanks @nhulston @joeyzhao2018 @purple4reina for discussion and helping debug.

Comment thread bottlecap/src/traces/trace_agent.rs Outdated
.route(LLM_OBS_SPANS_ENDPOINT_PATH, post(Self::llm_obs_spans_proxy))
.route(DEBUGGER_ENDPOINT_PATH, post(Self::debugger_logs_proxy))
.route(V1_DEBUGGER_ENDPOINT_PATH, post(Self::debugger_logs_proxy))
.route(V2_DEBUGGER_ENDPOINT_PATH, post(Self::debugger_logs_proxy))

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Is it correct to use Self::debugger_logs_proxy? Should any param here be different?

async fn debugger_logs_proxy(State(state): State<ProxyState>, request: Request) -> Response {
Self::handle_proxy(
state.config,
state.proxy_aggregator,
request,
"http-intake.logs",
DEBUGGER_LOGS_INTAKE_PATH,
"debugger_logs",
)
.await
}
@nhulston

@nhulston nhulston Nov 10, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sorry, I was incorrect in Slack. After looking at the datadog-agent code, it looks like the params changed in v2. See the suggested code changes in the other comments

@lym953
lym953 marked this pull request as ready for review November 10, 2025 20:36
@lym953
lym953 requested a review from a team as a code owner November 10, 2025 20:36
Comment thread bottlecap/src/traces/trace_agent.rs Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
const V1_DEBUGGER_LOGS_INTAKE_PATH: &str = "/api/v2/logs";
const V2_DEBUGGER_INTAKE_PATH: &str = "/api/v2/debugger";

Comment thread bottlecap/src/traces/trace_agent.rs

@nhulston nhulston left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good. Can we test in a real Lambda before merging?

@lym953

lym953 commented Nov 12, 2025

Copy link
Copy Markdown
Contributor Author

Tested. Will merge after v89 is released.

@lym953
lym953 merged commit 7375560 into main Nov 24, 2025
39 checks passed
@lym953
lym953 deleted the yiming.luo/debugger-proxy branch November 24, 2025 19:34
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