Skip to content

Commit

Permalink
Just close Riemann client on send metrics failure
Browse files Browse the repository at this point in the history
Signed-off-by: Eugene Chupriyanov <e.chupriyanov@cpm.ru>
  • Loading branch information
Eugene Chupriyanov committed Apr 18, 2016
1 parent 288b8e0 commit c237e6a
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions plugins/outputs/riemann/riemann.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c237e6a

Please sign in to comment.