Don't add port to tags just the host

This commit is contained in:
Sergio Jimenez 2016-01-31 23:14:10 +01:00 committed by Michele Fadda
parent b4d1be8ed7
commit a165c1c7c0
1 changed files with 4 additions and 2 deletions

View File

@ -211,12 +211,14 @@ func (m *Mesos) Gather(acc telegraf.Accumulator) error {
func (m *Mesos) gatherMetrics(a string, acc telegraf.Accumulator) error { func (m *Mesos) gatherMetrics(a string, acc telegraf.Accumulator) error {
var jsonOut map[string]interface{} var jsonOut map[string]interface{}
if _, _, err := net.SplitHostPort(a); err != nil { host, _, err := net.SplitHostPort(a)
if err != nil {
host = a
a = a + ":5050" a = a + ":5050"
} }
tags := map[string]string{ tags := map[string]string{
"server": a, "server": host,
} }
// TODO: Use Timeout // TODO: Use Timeout