In this code line, url.Parse is used to parse the given host string. If this string does not contain a scheme (e.g. google.com instead of tcp://google.com), u.Host is an empty string and the connect fails.
Bug report
Relevant telegraf.conf:
[[outputs.opentsdb]]
prefix = "telegraf."
host = "google.com"
port = 4242
System info:
Steps to reproduce:
Provide a host without a scheme to the OpenTSDB output plugin.
Expected behavior:
The plugin should be able connect to the host.
Actual behavior:
The connection fails with: Failed to connect to output opentsdb, retrying in 15s, error was 'OpenTSDB: Telnet connect fail'