Ensure that host.name is aligned with Elastic Agent system integration
- Dominant language
- Go
- Stars
- 1.3k
- Forks
- 543
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 109
Description
[APM Server sets host.hostname](https://github.com/elastic/apm-server/blob/7d2e2824986a86de02e37f06070c2dc51c97d8f0/model/modelprocessor/hostname.go#L39-L53) as follows:
1. if kubernetes.node.name is set, then we use that
2. otherwise, if any other kubernetes.* fields are set, we don't set host.hostname at all
3. finally, if no kubernetes.* fields are set, then we use detected_hostname
If `configured_hostname` is set, then we use that for `host.name`. If `configured_hostname` is not set, then we set `host.name` to the same value as `host.hostname`.
This complicated algorithm comes from https://github.com/elastic/apm/issues/21#issuecomment-476441441, where we intended to align with ECS (https://github.com/elastic/ecs/blob/1.0/use-cases/kubernetes.md). It is not explicitly captured in ECS, so we should verify that we're doing the right thing and update the docs (and Elastic Agent code if needed), or otherwise change the APM Server code.
Contributor guide
Assessment
This issue has not been assessed yet.