Skip to content

prototype: adding option to randomly select a host from DNS#25930

Draft
jimrollenhagen wants to merge 3 commits into
vectordotdev:masterfrom
jimrollenhagen:jroll/dns-options
Draft

prototype: adding option to randomly select a host from DNS#25930
jimrollenhagen wants to merge 3 commits into
vectordotdev:masterfrom
jimrollenhagen:jroll/dns-options

Conversation

@jimrollenhagen

@jimrollenhagen jimrollenhagen commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Fixes #23121

Putting this up as a prototype for now, will discuss and iterate.

(note: used Opus 4.6 to help me work this out)

Summary

Vector configuration

How did you test this PR?

Change Type

  • Bug fix
  • New feature
  • Dependencies
  • Non-functional (chore, refactoring, docs)
  • Performance

Is this a breaking change?

  • Yes
  • No

Does this PR include user facing changes?

  • Yes. Please add a changelog fragment based on our guidelines.
  • No. A maintainer will apply the no-changelog label to this PR.

References

Notes

  • Please read our Vector contributor resources.
  • Do not hesitate to use @vectordotdev/vector to reach out to us regarding this PR.
  • Some CI checks run only after we manually approve them.
    • We recommend adding a pre-push hook, please see this template.
    • Alternatively, we recommend running the following locally before pushing to the remote branch:
      • make fmt
      • make check-clippy (if there are failures it's possible some of them can be fixed with make clippy-fix)
      • make test
  • After a review is requested, please avoid force pushes to help us review incrementally.
    • Feel free to push as many commits as you want. They will be squashed into one before merging.
    • For example, you can run git merge origin master and git push.
  • If this PR introduces changes Vector dependencies (modifies Cargo.lock), please
    run make build-licenses to regenerate the license inventory and commit the changes (if any). More details on the dd-rust-license-tool.

@jimrollenhagen
jimrollenhagen requested a review from a team as a code owner July 22, 2026 21:45
@jimrollenhagen
jimrollenhagen marked this pull request as draft July 22, 2026 21:45
@github-actions github-actions Bot added the domain: sinks Anything related to the Vector's sinks label Jul 22, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Before we can merge this PR, please sign our Contributor License Agreement.

To sign, copy and post the phrase below as a new comment on this PR.

Note: If the bot says your username was not found, the email used in your git commit may not be linked to your GitHub account. Fix this at github.com/settings/emails, then comment recheck to retry.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@datadog-vectordotdev

datadog-vectordotdev Bot commented Jul 22, 2026

Copy link
Copy Markdown

Pipelines

⚠️ Warnings

🚦 1 Pipeline job failed

CLA Assistant | CLAAssistant   View in Datadog   GitHub Actions

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: cc00470 | Docs | Give us feedback!

@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: 4f08a2226a

ℹ️ 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".

/// - `random`: pick a single random address from the resolved set
#[configurable(derived)]
#[serde(default)]
pub(in crate::sinks::vector) dns_address_selection: DnsAddressSelection,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Wire DNS selection into the HTTP sink

For the scenario this change claims to address, users are sending through the http sink to a hostname with multiple DNS addresses, but this new option is scoped only to VectorConfig. The http sink still builds its client via HttpClient::new in src/sinks/http/config.rs, which goes through build_proxy_connector and HttpConnector::new() in src/http.rs, so dns_address_selection = "random" cannot be configured or applied there. As a result, the reported HTTP-sink traffic can remain stuck on the resolver's first address unless the option is plumbed into the shared HTTP client or the HTTP sink configuration.

Useful? React with 👍 / 👎.

});

let tls_for_proxy = tls_connector_builder(&tls_settings)?.build();
let mut proxy = ProxyConnector::new(https).unwrap();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Account for proxied vector endpoints

When a configured or environment proxy matches the Vector endpoint, this ProxyConnector dials the proxy URI and tunnels/forwards the original request, so the custom resolver installed on the inner HttpConnector resolves the proxy host rather than the downstream Vector hostname. In those deployments dns_address_selection = "random" silently has no effect on endpoint selection and traffic can remain pinned to whatever backend the proxy/DNS chooses; this should be rejected, warned about, or documented instead of exposing the option as if it applies to endpoint DNS.

Useful? React with 👍 / 👎.

@jimrollenhagen

Copy link
Copy Markdown
Contributor Author

recheck

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain: sinks Anything related to the Vector's sinks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use DNS addresses as returned from the server

1 participant