feat: Support proxy for debugger endpoint v2 by lym953 · Pull Request #918 · DataDog/datadog-lambda-extension

Conversation

@lym953

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.

lym953

.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))

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

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

nhulston

Choose a reason for hiding this comment

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

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

nhulston

nhulston

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

Tested. Will merge after v89 is released.

@lym953 lym953 deleted the yiming.luo/debugger-proxy branch

November 24, 2025 19:34

2 participants

@lym953 @nhulston