prometheus-community / PushProx

Proxy to allow Prometheus to scrape through NAT etc.
Apache License 2.0
704 stars 132 forks source link

use the recommended fqdn.FqdnHostname rathen than fqdn.Get #147

Open kjetilho opened 1 year ago

kjetilho commented 1 year ago

fqdn.Get is deprecated by the author:

// Deprecated: // This function has bad API, works poorly and is replace by // FqdnHostname. Please please do not use it. It will be removed // in the next version.

The old function resolves the FQDN by doing a forward lookup of the hostname, and then a reverse lookup of the IP address. This may lead to surprising results. The new function aims to give the same result as hostname -f.

Another problem with the fqdn.Get API is that it has no facility to return errors. This patch throws away the actual error for simplicity's sake, though.

SuperQ commented 1 year ago

This needs a DCO sign-off. You can use git commit -s --amend to add it.