diff --git a/plugins/outputs/influxdb/influxdb.go b/plugins/outputs/influxdb/influxdb.go index 5eef553a2..fca6b1db1 100644 --- a/plugins/outputs/influxdb/influxdb.go +++ b/plugins/outputs/influxdb/influxdb.go @@ -191,6 +191,12 @@ func (i *InfluxDB) Write(metrics []telegraf.Metric) error { break } } + + // If all of the writes failed, create a new connection array so that + // i.Connect() will be called on the next gather. + if err != nil { + i.conns = make([]client.Client) + } return err }