From c237e6a3c057c9805d1925a8cde551345ebd3d47 Mon Sep 17 00:00:00 2001 From: Eugene Chupriyanov Date: Tue, 19 Apr 2016 01:08:18 +0300 Subject: [PATCH] Just close Riemann client on send metrics failure Signed-off-by: Eugene Chupriyanov --- plugins/outputs/riemann/riemann.go | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/plugins/outputs/riemann/riemann.go b/plugins/outputs/riemann/riemann.go index 88c4b20def283..ee8a6f90259d2 100644 --- a/plugins/outputs/riemann/riemann.go +++ b/plugins/outputs/riemann/riemann.go @@ -80,15 +80,8 @@ func (r *Riemann) Write(metrics []telegraf.Metric) error { var senderr = r.client.SendMulti(events) if senderr != nil { r.Close() // always retuns nil - connerr := r.Connect() - if connerr != nil { - return fmt.Errorf("FAILED to (re)connect to Riemann. Error: %s\n", connerr) - } - senderr = r.client.SendMulti(events) - if senderr != nil { - return fmt.Errorf("FAILED to send riemann message (will try to reconnect). Error: %s\n", + return fmt.Errorf("FAILED to send riemann message (will try to reconnect). Error: %s\n", senderr) - } } return nil