Skip to content

RUM-16668: Add wildcard host pattern matching to first-party tracing#3600

Merged
kikoveiga merged 2 commits into
developfrom
kikoveiga/rum-16668/first-party-hosts-patterns
Jul 10, 2026
Merged

RUM-16668: Add wildcard host pattern matching to first-party tracing#3600
kikoveiga merged 2 commits into
developfrom
kikoveiga/rum-16668/first-party-hosts-patterns

Conversation

@kikoveiga

@kikoveiga kikoveiga commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

  • Adds wildcard pattern support to setFirstPartyHosts and setFirstPartyHostsWithHeaderType inside Configuration, which extends to ApmNetworkInstrumentationConfiguration and TracingInterceptor. Entries can now be a plain host (e.g. example.com) or a wildcard pattern such as *.example.com.
  • Routes wildcard entries to HostPatternSanitizer and plain entries to HostsSanitizer.
  • Matches hosts in DefaultFirstPartyHostHeaderTypeResolver against a precompiled regex per pattern. A * matches one or more host characters and may span subdomain labels, so *.example.com matches api.example.com and a.b.example.com but not the apex example.com.
  • Change: a bare * is no longer allowed as match-all. There were some tests on this, but it was actually unreachable in production as HostsSanitizer already dropped entries with * before the resolver.
  • Remove unused addKnownHosts function, as it was only used in tests.

Motivation

  • First-party host configuration previously only supported exact hosts and their subdomains, so dynamic subdomains had to be enumerated explicitly.

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Make sure you discussed the feature or bugfix with the maintaining team in an Issue
  • Make sure each commit and the PR mention the Issue number (cf the CONTRIBUTING doc)

@codecov-commenter

codecov-commenter commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.61905% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 72.89%. Comparing base (0443e2a) to head (b30efb2).
⚠️ Report is 143 commits behind head on develop.

Files with missing lines Patch % Lines
...tadog/android/core/configuration/HostsSanitizer.kt 87.50% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3600      +/-   ##
===========================================
+ Coverage    72.85%   72.89%   +0.03%     
===========================================
  Files          975      975              
  Lines        35277    35267      -10     
  Branches      5972     5976       +4     
===========================================
+ Hits         25700    25705       +5     
+ Misses        7915     7896      -19     
- Partials      1662     1666       +4     
Files with missing lines Coverage Δ
...atadog/android/core/configuration/Configuration.kt 99.07% <100.00%> (-0.02%) ⬇️
...android/core/configuration/HostPatternSanitizer.kt 96.67% <100.00%> (ø)
...nal/net/DefaultFirstPartyHostHeaderTypeResolver.kt 97.50% <100.00%> (+19.24%) ⬆️
...id/trace/ApmNetworkInstrumentationConfiguration.kt 78.67% <ø> (+1.14%) ⬆️
...lin/com/datadog/android/webview/WebViewTracking.kt 85.04% <ø> (ø)
...dog/android/webview/internal/DatadogEventBridge.kt 100.00% <100.00%> (ø)
...datadog/android/okhttp/trace/TracingInterceptor.kt 83.20% <ø> (+0.27%) ⬆️
...tadog/android/core/configuration/HostsSanitizer.kt 97.06% <87.50%> (-2.94%) ⬇️

... and 40 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kikoveiga
kikoveiga force-pushed the kikoveiga/rum-16668/first-party-hosts-patterns branch 2 times, most recently from e727462 to 932a370 Compare July 4, 2026 17:56
@kikoveiga kikoveiga self-assigned this Jul 6, 2026
@kikoveiga
kikoveiga force-pushed the kikoveiga/rum-16668/first-party-hosts-patterns branch 6 times, most recently from 9722a98 to 9ea7754 Compare July 7, 2026 14:00
@kikoveiga
kikoveiga marked this pull request as ready for review July 7, 2026 14:05
@kikoveiga
kikoveiga requested review from a team as code owners July 7, 2026 14:05

@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: 9ea77542b5

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@sbarrio
sbarrio requested a review from 0xnm July 8, 2026 07:05
@kikoveiga
kikoveiga force-pushed the kikoveiga/rum-16668/first-party-hosts-patterns branch from 9ea7754 to 9a9040e Compare July 8, 2026 15:41

@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: ebac038642

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@kikoveiga
kikoveiga force-pushed the kikoveiga/rum-16668/first-party-hosts-patterns branch from ebac038 to 79c8401 Compare July 9, 2026 15:49

@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: 79c84012c4

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@kikoveiga
kikoveiga force-pushed the kikoveiga/rum-16668/first-party-hosts-patterns branch from 79c8401 to 9c95e91 Compare July 9, 2026 16:05
@kikoveiga
kikoveiga force-pushed the kikoveiga/rum-16668/first-party-hosts-patterns branch from 9c95e91 to c12b1f1 Compare July 9, 2026 17:14
@kikoveiga
kikoveiga force-pushed the kikoveiga/rum-16668/first-party-hosts-patterns branch from c12b1f1 to b30efb2 Compare July 9, 2026 17:18
@kikoveiga
kikoveiga requested a review from abrooksv July 9, 2026 17:18
@kikoveiga
kikoveiga merged commit 2120276 into develop Jul 10, 2026
27 checks passed
@kikoveiga
kikoveiga deleted the kikoveiga/rum-16668/first-party-hosts-patterns branch July 10, 2026 13:03
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