elastic / apm

Elastic Application Performance Monitoring - resources and general issue tracking for Elastic APM.
https://www.elastic.co/apm
Apache License 2.0
384 stars 114 forks source link

add extra heuristic for hostname #838

Closed SylvainJuge closed 12 months ago

SylvainJuge commented 1 year ago

When using very minimal container images like the distroless, the hostname command line tool that our agents use to capture the host name is missing and can't be used.

When no value is captured for host name, the most obvious symptom is missing metrics in Kibana, the traces are not impacted.

While the HOST and HOSTNAME environment variables allow to provide a fallback, adding them to very large deployments can become an extra burden.

However, reading the content of the /etc/hostname is still possible and we should then use it to provide a value to the host name. In this case we don't know if a simple host name or an FQDN is provided.

In containers the actual value is usually the container ID or a random string thus it's not for "human consumption" but is still relevant for correlation.

In short, this just adds an extra fallback option to existing heuristics.


Mpdreamz commented 12 months ago

Similar in .NET we don't call hostname directly.