Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support fully qualified domain name in host #10741

Closed
simitt opened this issue May 3, 2023 · 8 comments
Closed

Support fully qualified domain name in host #10741

simitt opened this issue May 3, 2023 · 8 comments
Milestone

Comments

@simitt
Copy link
Contributor

simitt commented May 3, 2023

Problem

ECS changed the definition of host.name and encourages to use the fully qualified domain name for the host name.

All Elastic ECS producers should populate the host.name field with the lowercased FQDN from here forward.

Solution

The Elastic Agent supports this behind a feature flag (to avoid breaking changes for users).

The APM agents need to collect the host.domain information, but only the APM server knows if the Elastic agent is configured to store the FQDN. The server needs to query this configuration from the Elastic agent policy, and if enabled, prepend the domain name to the host to yield a FQDN.

related elastic/apm#793

@simitt simitt added this to the 8.9 milestone May 3, 2023
@trentm
Copy link
Member

trentm commented May 9, 2023

From discussion in the Agents meeting today, the system.detected_hostname (or the system.hostname for those agents that still haven't implemented system.detected_hostname) from some agents will include the domain info, and from some agents it will just be the simple hostname without domain info.

That means that creating the FQDN in apm-server will involve a heuristic to determine if the hostname info includes domain info.

@simitt
Copy link
Contributor Author

simitt commented May 10, 2023

@trentm is that described logic already the case or are different agents just going to have different implementations in the future? In case of the latter, then I'd be curious to know why you would prefer that over adding a dedicated new fieldfor the FQDN?

@trentm
Copy link
Member

trentm commented May 10, 2023

is that described logic already the case or ...

My understanding from the discussion is that it is already the case.

  • Node.js APM agent: sends metadata.system.hostname (the old deprecated name) with domain info (e.g. pink.local on my macOS laptop)
  • Python: same as Node.js agent
  • Ruby: metadata.system.detected_hostname: "pink.local" with domain info
  • .NET (from the discussion): metadata.system.detected_hostname without domain info
  • Java: I don't know

@simitt
Copy link
Contributor Author

simitt commented May 11, 2023

What about configured_hostname? If that doesn't contain the FQDN, there is no way that the apm-server could add it to the hostname, when indicated so by the Elastic Agent configuration.

@trentm
Copy link
Member

trentm commented May 11, 2023

What about configured_hostname? ...

If the user sets export ELASTIC_APM_HOSTNAME=my-computer, i.e. not a FQDN, then the APM agent should send: configured_hostname: "my-computer" and detected_domain_name: "example.biz".
I suppose APM server could assume those can be joined and yield host.name: "my-computer.example.biz".

If the configured_hostname (or detected_hostname) has dots in it, then I'm not sure how smart APM server needs to get to decide if it is a FQDN. For example detected_hostname: "fred.local" is a FQDN, but "cs123.computer-department" isn't.

@axw
Copy link
Member

axw commented May 12, 2023

If various agents are already sending an FDQN, and we want to end up with them all doing that, I wonder if it is worth the complexity of sending additional information and joining fields server-side.

What's the downside of simply updating the agents that send an unqualified hostname to send an FQDN?

@trentm
Copy link
Member

trentm commented May 12, 2023

What's the downside of simply updating the agents that send an unqualified hostname to send an FQDN?

From the APM agents weekly discussion the downside mentioned was that it would potentially be considered a breakage for users upgrading that agent. (I don't have a strong opinion either way here.)

/cc @stevejgordon @gregkalapos

@simitt
Copy link
Contributor Author

simitt commented Jun 29, 2023

Closing this issue according to the plans to support FQDN directly in the apm agents (see spec draft).

@simitt simitt closed this as completed Jun 29, 2023
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

No branches or pull requests

3 participants