diff --git a/plugins/outputs/socket_writer/socket_writer.go b/plugins/outputs/socket_writer/socket_writer.go index 7c4660bc8..8b0f56acc 100644 --- a/plugins/outputs/socket_writer/socket_writer.go +++ b/plugins/outputs/socket_writer/socket_writer.go @@ -137,6 +137,7 @@ func (sw *SocketWriter) Write(metrics []telegraf.Metric) error { // permanent error. close the connection sw.Close() sw.Conn = nil + return fmt.Errorf("closing connection: %v", err) } return err }