-
Notifications
You must be signed in to change notification settings - Fork 114
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
Updating the metadata hostname specification #517
Conversation
@elastic/apm-agent-devs we just got a report that the link from APM traces to host metrics may be broken if the hostname discovery is not done as specified hereby, so please take a quick look to see whether such a fix is required in your agent
💚 Build Succeeded
Expand to view the summary
Build stats
|
Co-authored-by: Felix Barnsteiner <[email protected]>
Co-authored-by: Colton Myers <[email protected]>
Following the requirement to provide a more comprehensive hostname detection algorithm and make it as compatible as possible with beats, I did some digging with the beats team and changed the spec accordingly. I don't have enough resources to asses how generic and comprehensive it is, other than seeing it working wherever I tried it. It is certainly not 100% bulletproof, but our goals are more modest for now. Any comments, proposals and enhancements are very welcome. @elastic/apm-agent-devs - please take a look, even if you did already. |
Is using a language's standard library method for getting the hostname (e.g. Executing |
@trentm I think the consensus is that the On the Windows end of things, I've been banging the drum for our python agent to drop Windows support anyway because we have no confirmed Windows users. So I'm not stressing about that side, at least for Python. |
👍 This is tricky indeed. Eventually, what we need is a language-independent spec. That's the only reason I chose to put it this way, but everything that can be done without invoking an external process is of course preferable, as long as it yields the same result. Lastly, I just learned that the currently proposed algorithm can either return the simple hostname OR FQDN, so I will probably extend the algorithm a little bit to handle that. |
Added some clarification on what can be used to replace invocation of external commands and extended the algorithm to clear domain parts if the discovered value is a FQDN. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@elastic/apm-agent-devs we just got a report that the link from APM traces to host metrics may be broken if the hostname discovery is not done as specified hereby, so please take a quick look to see whether such a fix is required in your agent
os.hostname()
, which uses thegethostname
syscall)socket.gethostname()
, which uses thegethostname
syscall)gethostname
which is a trivial wrapper aroundgethostname
syscall)