Skip to content

Conversation

@lym953
Copy link
Contributor

@lym953 lym953 commented Nov 10, 2025

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.

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

Copy link
Contributor

@nhulston nhulston Nov 10, 2025

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
const LLM_OBS_EVAL_METRIC_INTAKE_PATH: &str = "/api/intake/llm-obs/v1/eval-metric";
const LLM_OBS_EVAL_METRIC_INTAKE_PATH_V2: &str = "/api/intake/llm-obs/v2/eval-metric";
const PROFILING_INTAKE_PATH: &str = "/api/v2/profile";
const DEBUGGER_LOGS_INTAKE_PATH: &str = "/api/v2/logs";
Copy link
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";

Copy link
Contributor

@nhulston nhulston left a comment

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
Copy link
Contributor Author

lym953 commented Nov 12, 2025

Tested. Will merge after v89 is released.

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.

3 participants