fix(sinks): separate Datadog validation from runtime construction - #26145
fix(sinks): separate Datadog validation from runtime construction#26145kurochan wants to merge 1 commit into
Conversation
39bef88 to
78bf4f2
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 78bf4f2fb0
ℹ️ 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".
| pub fn validate_endpoint(&self) -> crate::Result<()> { | ||
| if let Some(endpoint) = &self.endpoint { | ||
| HttpEndpoint::parse(endpoint)?; | ||
| } | ||
|
|
||
| Ok(()) |
There was a problem hiding this comment.
Validate explicit sites when no endpoint is set
When endpoint is absent but site is explicitly malformed (for example, site = "bad site"), this helper returns Ok(()) without constructing the site-derived URL. The logs, metrics, and traces validators now rely on this helper, whereas their previous implementations parsed the URL derived from the configured site, so vector validate --no-environment now accepts a structurally unusable local configuration and defers the error until runtime construction. Validate a locally supplied site's derived base URL while continuing to defer values that come only from global runtime options.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
To use Codex here, create an environment for this repo.
Signed-off-by: kurochan <[email protected]>
78bf4f2 to
e214d33
Compare
Summary
Separate Datadog sink configuration validation from runtime construction.
In restricted environments such as CI, containers, and AI coding-agent sandboxes,
vector validate --no-environmentis expected to validate structural configurationwithout opening outbound connections or initializing runtime resources such as native
TLS trust stores.
Previously, Datadog sink validation could reach runtime client/TLS construction even
when no outbound request was made. In restricted sandbox environments, the macOS
Keychain may be unavailable; attempting to load native root certificates through it
caused validation to panic.
This PR makes the boundary explicit:
traces sinks into
ValidatedSink::validate.in the runtime build path.
TracesSink::runlifecycle.delay shutdown indefinitely.
verification is disabled.
sink-specific validation/build drift.
Regular
vector validatecontinues to build all sinks and remains the validationmode for errors that require effective runtime construction.
--no-environmentintentionally does not guarantee detection of every runtime construction error.
The APM flusher acknowledgement confirms that the final flush was attempted; it does
not guarantee that Datadog accepted the payload.
References
N/A
Vector configuration
No new user configuration was added. Unit tests cover the Datadog logs, metrics,
events, and traces sinks with their existing inline configurations and custom
endpoints.
How did you test this PR?
cargo test -p vector --lib datadogcargo test -p vector-core tls::settings::testcargo test -p vector --lib sinks::datadog::traces::sink::testscargo check -p vector --libmake check-clippycargo fmt --all -- --checkmake check-changelog-fragmentsIs this a breaking change?
Does this PR include user facing changes?
no-changeloglabel to this PR.