Skip invalid urls in nginx input

This commit is contained in:
Daniel Nelson 2017-10-03 10:54:31 -07:00
parent ea11fae57b
commit 9257f3b148
2 changed files with 2 additions and 0 deletions

View File

@ -72,6 +72,7 @@ func (n *Nginx) Gather(acc telegraf.Accumulator) error {
addr, err := url.Parse(u) addr, err := url.Parse(u)
if err != nil { if err != nil {
acc.AddError(fmt.Errorf("Unable to parse address '%s': %s", u, err)) acc.AddError(fmt.Errorf("Unable to parse address '%s': %s", u, err))
continue
} }
wg.Add(1) wg.Add(1)

View File

@ -59,6 +59,7 @@ func (n *NginxPlus) Gather(acc telegraf.Accumulator) error {
addr, err := url.Parse(u) addr, err := url.Parse(u)
if err != nil { if err != nil {
acc.AddError(fmt.Errorf("Unable to parse address '%s': %s", u, err)) acc.AddError(fmt.Errorf("Unable to parse address '%s': %s", u, err))
continue
} }
wg.Add(1) wg.Add(1)