Skip to content

OpenTSDB output plugin broken when host is given without scheme #2299

@alfredkrohmer

Description

@alfredkrohmer

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:

  • Telegraf version 1.1.2

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'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions