[AGNTLOG-182] feat: add site config option#86
Open
gh123man wants to merge 7 commits into
Open
Conversation
ddrthall
reviewed
May 20, 2026
ddrthall
reviewed
May 20, 2026
ddrthall
reviewed
May 29, 2026
ddrthall
reviewed
May 29, 2026
Adds a `site` configuration parameter (default `datadoghq.com`) that derives the default intake host. Explicit `host` values continue to win over the site-derived default. The `host` default is now derived as: - HTTP forwarding: `http-intake.logs.<site>` - TCP forwarding: `agent-intake.logs.<site>` Supports the standard Datadog sites (`datadoghq.com`, `datadoghq.eu`, `us3.datadoghq.com`, `us5.datadoghq.com`, `ap1.datadoghq.com`, `ddog-gov.com`). README updated; tests cover default, EU site, TCP site derivation, and explicit `host` override precedence. JIRA: https://datadoghq.atlassian.net/browse/AGNTLOG-182 Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Preserves the previously-documented TCP intake host (intake.logs.datadoghq.com) that existing users rely on, instead of switching to agent-intake.logs.<site>. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
TCP is deprecated and out of scope for the site config feature. Removed the TCP host prefix constant, TCP-aware derivation, and the TCP-specific tests. Site now only changes the default HTTP host. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
The previous commit removed master's existing TCP-mode host fallback (swap to DD_DEFAULT_TCP_ENDPOINT when use_http=false and host is the default HTTP endpoint). That existed before this PR and should not have been removed. Restored the block verbatim in its original position (after `return if @dd_hostname`) and re-added the derived DD_DEFAULT_HTTP_ENDPOINT constant it compares against. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
…owlist validation C1: Only derive `http-intake.logs.<site>` host when `use_http` is true. TCP users with a non-default site were silently receiving an HTTP intake hostname, which is now prevented. TCP + default site retains the legacy fallback to DD_DEFAULT_TCP_ENDPOINT. R1: Validate `site` against a shape regex on configure, raising Fluent::ConfigError for values that don't match the documented pattern (e.g. "datadog.eu" instead of "datadoghq.eu"). Adds 8 tests covering: HTTP site derivation, TCP fallback, TCP with explicit host, invalid site rejection, gov site, and subdomain site. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
The Datadog Agent does not validate the `site` config string — see
pkg/config/setup/common_settings.go:1135 (`BindEnv("site")` only, no
default, no validation) and pkg/config/utils/endpoints.go:72-73 where
`GetMainEndpoint` builds the URL as `prefix + strings.TrimSpace(site)`.
A typo like `site: datadog.eu` produces `agent-http-intake.logs.datadog.eu`
and surfaces at DNS resolution time.
Removes the DD_SITE_PATTERN regex + ConfigError raise added in 9dd80a3
so this plugin matches that behavior. Also matches the sibling
serilog-sinks-datadog-logs and logstash-output-datadog_logs `site`
work, which document valid sites in their README but do not validate
at runtime.
Documentation in the README is kept — that's the validation channel
we use across the Datadog product surface.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
…rror Addresses Cursor review C1/C2 on #86. Before this change, the combination of `use_http false` + a non-default `site` + no explicit `host` left `@host` as nil/empty in `configure`, and the failure only surfaced at connect-time inside the TCP client as a cryptic error. The existing test that claimed to exercise this branch actually passed an explicit `host` and validated the wrong path. Raise `Fluent::ConfigError` for this case with an actionable message pointing at the likely TCP intake hostname (`intake.logs.<site>`). Replace the misleading test with one that drives the genuinely new branch and asserts the raise. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
4600947 to
0531144
Compare
ddrthall
approved these changes
Jun 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
siteconfiguration parameter to the Fluentd Datadog output plugin so users can pick a Datadog site without needing to overridehostmanually. This brings the plugin in line with other Datadog forwarding libraries.JIRA: https://datadoghq.atlassian.net/browse/AGNTLOG-182
Changes
config_param :site, :string, default: "datadoghq.com".hostdefault is now derived fromsite:http-intake.logs.<site>use_http false):agent-intake.logs.<site>hostalways wins over the site-derived default — this preserves backwards compatibility for any existing config that pinshost.datadoghq.com,datadoghq.eu,us3.datadoghq.com,us5.datadoghq.com,ap1.datadoghq.com,ddog-gov.com).Test plan
bundle exec rake test— 34 tests, 71 assertions, 0 failures (baseline was 29 tests; 5 new tests added)site, nohost) still resolves tohttp-intake.logs.datadoghq.comsite datadoghq.euresolves HTTP host tohttp-intake.logs.datadoghq.eusite us5.datadoghq.comwithuse_http falseresolves TCP host toagent-intake.logs.us5.datadoghq.comhost my-custom-intake.example.comoverrides site-derived default (HTTP and TCP)Co-Authored-By: Claude Opus 4.7 (1M context) [email protected]