Skip to content

chore(writer): unify agentless intake to use browser-intake #18537

Draft
mabdinur wants to merge 16 commits into
mainfrom
munir/refactor-agentless-intake-url
Draft

chore(writer): unify agentless intake to use browser-intake #18537
mabdinur wants to merge 16 commits into
mainfrom
munir/refactor-agentless-intake-url

Conversation

@mabdinur

@mabdinur mabdinur commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Migrates all known Datadog sites off legacy trace intake endpoints (public-trace-http-intake.logs.*, trace.browser-intake-*) to the unified browser-intake-* pattern. Gets rid of the legacy endpoints.

Test plan

Logic is tested across existing tests:

  • test_agentless_intake_url_known_sites— parametrized fromAGENTLESS_TRACE_INTAKE_URLS`, covers all 8 known sites
  • test_agentless_intake_url_unknown_site_uses_browser_intake_fallback — verifies fallback URL derivation and warning for unrecognized sites (gov sites, future regions)
  • test_agentless_trace_writer_intake_url — subprocess test verifying end-to-end writer URL for each DD_SITE

mabdinur and others added 11 commits June 8, 2026 11:36
…ndpoint

Switch AgentlessTraceWriter from the deprecated public-trace-http-intake.logs
endpoint to browser-intake-*/api/v2/spans. Fix URL construction to correctly
handle multi-region DD_SITE values (e.g. us3.datadoghq.com → browser-intake-us3-datadoghq.com).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… test; add release note

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace the rpartition URL derivation with an explicit _agentless_intake_url()
function that mirrors the backend if/elif/else routing:
- us3/us5: trace.browser-intake-{region}-datadoghq.com
- ap1/ap2: browser-intake-{region}-datadoghq.com
- default: public-trace-http-intake.logs.{site}

Remove AgentlessTraceWriter.INTAKE_HOST which is no longer meaningful.
Update test expected URLs accordingly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…n customer impact

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…nt or explicit agentless

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… cases

Switch from substring to startswith("<region>.") matching to guard against
future sites sharing a prefix (e.g. ap1 vs ap10). Add explicit cases for
ddog-gov.com and us2.ddog-gov.com which have no public-trace-http-intake.logs
entry in the intake registry and require browser-intake-* instead.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Munir Abdinur <munir.abdinur@datadoghq.com>
@mabdinur mabdinur requested review from a team as code owners June 9, 2026 13:57
@mabdinur mabdinur requested review from brettlangdon and rachelyangdog and removed request for a team June 9, 2026 13:57
@datadog-datadog-prod-us1-2

datadog-datadog-prod-us1-2 Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Pipelines  Tests

Fix all issues with BitsAI

⚠️ Warnings

🚦 15 Pipeline jobs failed

DataDog/apm-reliability/dd-trace-py | build linux serverless: [amd64, cp315-cp315, v113741238-d2b8243-manylinux2014_x86_64, 1]   View in Datadog   GitLab

DataDog/apm-reliability/dd-trace-py | build linux serverless: [amd64, cp315-cp315, v113741491-d2b8243-musllinux_1_2_x86_64, 1]   View in Datadog   GitLab

DataDog/apm-reliability/dd-trace-py | build linux serverless: [arm64, cp315-cp315, v113741357-d2b8243-manylinux2014_aarch64, 1]   View in Datadog   GitLab

View all 15 failed jobs.

ℹ️ Info

No other issues found (see more)

🧪 All tests passed
❄️ No new flaky tests detected

🔄 Datadog auto-retried 7 jobs - 7 passed on retry View in Datadog

Useful? React with 👍 / 👎

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

@cit-pr-commenter-54b7da

cit-pr-commenter-54b7da Bot commented Jun 9, 2026

Copy link
Copy Markdown

Codeowners resolved as

ddtrace/internal/constants.py                                           @DataDog/apm-core-python
ddtrace/internal/writer/writer.py                                       @DataDog/apm-core-python
tests/tracer/test_writer.py                                             @DataDog/apm-sdk-capabilities-python @DataDog/apm-core-python

Comment thread tests/tracer/test_writer.py Outdated
("ap2.datadoghq.com", "https://browser-intake-ap2-datadoghq.com"),
("ddog-gov.com", "https://browser-intake-ddog-gov.com"),
("us2.ddog-gov.com", "https://browser-intake-us2-ddog-gov.com"),
("uk1.datadoghq.com", "https://browser-intake-uk1-datadoghq.com"),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

can we try a sub.sub.domain.com type example, just to hard code the explicit behavior you are implementing

@brettlangdon brettlangdon added changelog/no-changelog A changelog entry is not required for this PR. backport 4.11 labels Jun 9, 2026
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

This change is marked for backport to 4.11, but it conflicts with that branch.
Attempting to cherrypick this change to 4.11 yielded the following error:

Auto-merging ddtrace/internal/writer/writer.py
CONFLICT (content): Merge conflict in ddtrace/internal/writer/writer.py
Auto-merging tests/tracer/test_writer.py
CONFLICT (content): Merge conflict in tests/tracer/test_writer.py
error: could not apply daaf62e5a5... Merge 837735940656fe19b2e172bb72bbb23f6d2ed5ca into 6928d4515b5bed1e93bfc9879244a833d211fb87

The command used to test backporting was

git fetch origin 4.11 && git checkout origin/4.11 && git checkout -b backport--to-4.11 && git cherry-pick -x --mainline 1 daaf62e5a52ad9dec5be5bf5b3f5f1347de8c70e

@pr-commenter

pr-commenter Bot commented Jun 9, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-06-11 05:52:21

Comparing candidate commit 4fdf49a in PR branch munir/refactor-agentless-intake-url with baseline commit fad150f in branch main.

Found 0 performance improvements and 1 performance regressions! Performance is the same for 384 metrics, 9 unstable metrics.

scenario:span-start

  • 🟥 execution_time [+1.333ms; +1.518ms] or [+8.655%; +9.856%]

@mabdinur mabdinur force-pushed the munir/update-intake-llm0 branch 2 times, most recently from ca57646 to 928a776 Compare June 9, 2026 15:02
@mabdinur mabdinur force-pushed the munir/update-intake-llm0 branch from 928a776 to 4b43489 Compare June 9, 2026 15:04
…ntake pattern

Replaces per-site if/elif chain with a single algorithm: prepend
`browser-intake-` to the ddsite, replacing the first dot with a dash
for sites that carry a region prefix (2+ dots). Fixes the broken
`public-trace-http-intake.logs.*` fallback used for gov sites (that
endpoint does not exist there) and removes the inconsistent `trace.`
prefix on us3/us5.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@mabdinur mabdinur force-pushed the munir/refactor-agentless-intake-url branch from 8377359 to f8c52a4 Compare June 9, 2026 15:10
@mabdinur mabdinur marked this pull request as draft June 9, 2026 15:47
@mabdinur mabdinur changed the title refactor(writer): unify agentless intake URL derivation via browser-intake pattern chore(writer): unify agentless intake to use browser-intake Jun 9, 2026
Base automatically changed from munir/update-intake-llm0 to main June 9, 2026 17:26
Comment thread ddtrace/internal/constants.py Outdated
Comment thread ddtrace/internal/writer/writer.py Outdated
Comment thread tests/tracer/test_writer.py Outdated
mabdinur added 2 commits June 11, 2026 01:23
Co-authored-by: Munir Abdinur <munir.abdinur@datadoghq.com>
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