Repository navigation
instance: only look the FQDN up in beat receivers when features.fqdn is enabled - #53727
Merged
Merged
Conversation
NewBeatForReceiver looks the host FQDN up once per process, with a one minute timeout. When the lookup cannot succeed, for example because the DNS server does not answer for the host name, it always waits for the whole timeout, and every receiver waits for it because they share the result. On such a host the collector started 60s after the agent started it, before running any check. The lookup is best effort: on failure the receiver falls back to the OS hostname. Lower the timeout to 5s so a failing lookup costs 5s instead of 60s. A working lookup takes milliseconds and is not affected, a lookup slower than 5s now falls back to the hostname instead of waiting for the answer.
Contributor
🤖 GitHub commentsJust comment with:
|
Contributor
|
This pull request does not have a backport label.
To fixup this pull request, you need to add the backport labels for the needed
|
…is enabled Info.FQDN is only read through FQDNAwareHostname, when features.fqdn is enabled. NewBeatForReceiver looked the FQDN up regardless, so on a host whose DNS server does not answer for the host name every receiver waited a minute for a value nothing used. Receivers only get the feature flags from their own config, read before the lookup, so skip the lookup when the feature is disabled and set Info.FQDN to the hostname. Keep the one minute timeout when the feature is enabled, the same as add_host_metadata, so the two keep agreeing on the FQDN.
shahzad31
marked this pull request as ready for review
November 2, 2026 13:51
swiatekm
approved these changes
Nov 2, 2026
cmacknz
approved these changes
Nov 2, 2026
Contributor
|
This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again. |
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.
Proposed commit message
Checklist
I have made corresponding changes to the documentationI have made corresponding change to the default configuration files./changelog/fragmentsusing the changelog tool.Disruptive User Impact
None. With
features.fqdndisabled the FQDN was never read. With it enabled the lookup and its timeout are unchanged.Standalone beats are not changed. Under Elastic Agent they can switch
features.fqdnat runtime through the V2 manager without running init again, so they still need the FQDN looked up up front.How to test this PR locally
End to end: on a host whose DNS server does not answer for the host name, start a beat receiver (for example the Heartbeat receiver under Elastic Agent) with
features.fqdndisabled. The receiver starts right after "Beat ID" instead of a minute later, and logs no "unable to lookup FQDN" warning.Related issues
Use cases
Collectors and agents on hosts with a slow or unreachable DNS server start their beat receivers a minute earlier when
features.fqdnis disabled, which is the default.Logs
N/A