Skip to content

chore(debugger): correct agent endpoint matching#19124

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit into
mainfrom
tyler.finethy/fix-debugger-unsupported-agent-log-spam
Jul 17, 2026
Merged

chore(debugger): correct agent endpoint matching#19124
gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit into
mainfrom
tyler.finethy/fix-debugger-unsupported-agent-log-spam

Conversation

@tylfin

@tylfin tylfin commented Jul 16, 2026

Copy link
Copy Markdown
Member

Description

The tracer sometimes incorrectly reported a supported Datadog Agent as unsupported, which disabled Dynamic Instrumentation, Exception Replay, and Code Origin for Spans uploads and logged a repeated "unsupported agent" warning.

This fixes the Agent capability detection so supported Agents are recognized correctly, and reduces how often the check runs when an Agent genuinely lacks the required endpoints.

Testing

Updated the signal uploader unit tests to cover Agent capability detection and the throttled check.

Risks

Low. Agent detection is more robust; genuinely unsupported Agents are still handled as before.

Additional Notes

None.

@cit-pr-commenter-54b7da

cit-pr-commenter-54b7da Bot commented Jul 16, 2026

Copy link
Copy Markdown

Codeowners resolved as

ddtrace/debugging/_uploader.py                                          @DataDog/debugger-python
ddtrace/internal/agent.py                                               @DataDog/apm-core-python
tests/debugging/test_uploader.py                                        @DataDog/debugger-python

@cit-pr-commenter-54b7da

cit-pr-commenter-54b7da Bot commented Jul 16, 2026

Copy link
Copy Markdown

Circular import analysis

⚠️ Existing circular imports

There are 45 circular imports that already exist on the base branch and have not been changed by this PR.

Show existing cycles (showing 5 of 45 shortest)
ddtrace._trace.span -> ddtrace.internal.core -> ddtrace._trace.span
ddtrace.internal.datastreams -> ddtrace.internal.datastreams.kombu -> ddtrace.internal.datastreams
ddtrace.internal.datastreams -> ddtrace.internal.datastreams.kafka -> ddtrace.internal.datastreams
ddtrace.internal.datastreams -> ddtrace.internal.datastreams.botocore -> ddtrace.internal.datastreams
ddtrace.internal.datastreams -> ddtrace.internal.datastreams.google_cloud_pubsub -> ddtrace.internal.datastreams

To see all cycles, download the cycles-base.json and cycles-pr.json artifacts from this CI job and run:

uv run --script scripts/import-analysis/cycles.py compare cycles-base.json cycles-pr.json

@tylfin
tylfin force-pushed the tyler.finethy/fix-debugger-unsupported-agent-log-spam branch from ee127ab to 7168ecd Compare July 16, 2026 19:26
@tylfin tylfin changed the title fix(debugger): stop unsupported agent log spam fix(debugger): correct agent endpoint matching Jul 16, 2026
@tylfin
tylfin force-pushed the tyler.finethy/fix-debugger-unsupported-agent-log-spam branch from 7168ecd to a7e104f Compare July 16, 2026 19:29
@tylfin
tylfin marked this pull request as ready for review July 16, 2026 19:30
@tylfin
tylfin requested review from a team as code owners July 16, 2026 19:30

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

Copy link
Copy Markdown

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: a7e104f9c0

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread ddtrace/internal/agent.py Outdated
@datadog-datadog-us1-prod

datadog-datadog-us1-prod Bot commented Jul 16, 2026

Copy link
Copy Markdown

Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

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

@pr-commenter

pr-commenter Bot commented Jul 16, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-07-17 14:44:12

Comparing candidate commit 3a882ea in PR branch tyler.finethy/fix-debugger-unsupported-agent-log-spam with baseline commit 4440d38 in branch main.

Found 0 performance improvements and 4 performance regressions! Performance is the same for 612 metrics, 10 unstable metrics.

scenario:iastaspects-index_aspect

  • 🟥 execution_time [+11.496µs; +15.602µs] or [+8.586%; +11.652%]

scenario:iastaspectsospath-ospathbasename_aspect

  • 🟥 execution_time [+108.665µs; +112.551µs] or [+25.071%; +25.968%]

scenario:span-start

  • 🟥 execution_time [+1.448ms; +1.655ms] or [+9.228%; +10.546%]

scenario:telemetryaddmetric-1-count-metric-1-times

  • 🟥 execution_time [+161.956ns; +208.900ns] or [+7.765%; +10.016%]

@tylfin
tylfin force-pushed the tyler.finethy/fix-debugger-unsupported-agent-log-spam branch from a7e104f to 49d05ad Compare July 17, 2026 12:57
@tylfin tylfin added the changelog/no-changelog A changelog entry is not required for this PR. label Jul 17, 2026
@tylfin tylfin changed the title fix(debugger): correct agent endpoint matching chore(debugger): correct agent endpoint matching Jul 17, 2026
@datadog-datadog-us1-prod

datadog-datadog-us1-prod Bot commented Jul 17, 2026

Copy link
Copy Markdown

View session in Datadog

Bits Code status: ✅ Done

Comment @DataDog to request changes

@tylfin
tylfin force-pushed the tyler.finethy/fix-debugger-unsupported-agent-log-spam branch 2 times, most recently from ce06670 to 0ba3953 Compare July 17, 2026 13:06

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

Copy link
Copy Markdown

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: ce06670d07

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread ddtrace/internal/agent.py Outdated
Comment thread ddtrace/internal/agent.py
@tylfin
tylfin force-pushed the tyler.finethy/fix-debugger-unsupported-agent-log-spam branch from 0ba3953 to 1decfa3 Compare July 17, 2026 13:31

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

Copy link
Copy Markdown

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: 1decfa3891

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread ddtrace/internal/agent.py Outdated
The agent's /info endpoints list may or may not include a leading slash
depending on the agent version. The signal uploader only matched the
leading-slash form, so newer agents that advertise the debugger endpoints
without one were misreported as unsupported: snapshot and log uploads were
disabled and an "unsupported agent" warning was logged on every upload
cycle (as often as once per second).

Normalize the advertised endpoints before matching, consistent with remote
config and CI visibility. Also throttle the agent capability check when the
agent is reachable but does not advertise the required endpoints, so the
warning is not logged every tick. The throttle is scoped to that case only
(transient /info failures and upload failures on a supported agent still
recover on the next tick) and is reset on fork so a child re-checks
immediately.
@tylfin
tylfin force-pushed the tyler.finethy/fix-debugger-unsupported-agent-log-spam branch from 1decfa3 to 3a882ea Compare July 17, 2026 14:18
@tylfin

tylfin commented Jul 17, 2026

Copy link
Copy Markdown
Member Author

@codex review

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

Copy link
Copy Markdown

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: 3a882ea484

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread ddtrace/internal/agent.py
Comment thread ddtrace/debugging/_uploader.py
Comment thread ddtrace/debugging/_uploader.py
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot merged commit d9e9b69 into main Jul 17, 2026
1259 checks passed
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot deleted the tyler.finethy/fix-debugger-unsupported-agent-log-spam branch July 17, 2026 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/no-changelog A changelog entry is not required for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants