Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Report detected/configured_hostname and fix tests #1891
Report detected/configured_hostname and fix tests #1891
Changes from 2 commits
942ed73
2bf3723
d106cf9
3322329
8a428e8
06a9dd9
8e0b5e2
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
For comparison, here is the Node.js APM agent impl: https://github.com/elastic/apm-agent-nodejs/blob/main/lib/apm-client/http-apm-client/detect-hostname.js#L28-L77
which is almost, but not quite what is spec'd at https://github.com/elastic/apm/blob/main/specs/agents/metadata.md#hostname (I didn't fallback to the
HOSTNAME
andHOST
envvars).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.
Oh, interesting, you actually shell out as spec'd. I'll have to think on that. It's not very pythonic. 🤔
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.
I don't love shelling out, but all the reading and poking around I did suggested that
hostname -f
is the authoritative way to get the FQDN on non-Windows systems, and re-implementinghostname -f
functionality in Node.js at least wasn't feasible. Then on Windows I followed the spec to exec the powershell thing.Given that Python has the FQDN-related function, I can understand your wanting to just use that.
Note that I do occasionally get this on my macOS:
which is something related to the IPv6 localhost addr and perhaps the entry in
/etc/hosts
. That I get it only sometimes is weird: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.
It's a good thing to know. If we run into issues we can re-visit. But for now, I have limited python agent time so I'm going to call it "good enough" :)