-
Notifications
You must be signed in to change notification settings - Fork 326
Open
Labels
Description
I ran into this issue due to lack of hostname command on the container.
2025-04-01 11:21:56,560 [elastic-apm-metadata-0] INFO co.elastic.apm.agent.impl.metadata.SystemInfo - Failed to execute command "hostname -f" with exit code -1
2025-04-01 11:21:56,560 [elastic-apm-metadata-0] DEBUG co.elastic.apm.agent.impl.metadata.SystemInfo - Command execution error
java.io.IOException: Cannot run program "hostname": error=2, No such file or directory
apm-agent-java/apm-agent-core/src/main/java/co/elastic/apm/agent/impl/metadata/SystemInfo.java
Line 223 in 93f28fe
| logger.info("Failed to execute command {} with exit code {}", cmdAsString(cmd), commandOutput.getExitCode()); |
It would be beneficial to abandon calling this command and do so in java to avoid such error as well as a small performance improvement.
String hostname = InetAddress.getLocalHost().getHostName();