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>

closes #1013
  • Loading branch information
Eugene Chupriyanov authored and sparrc committed Apr 18, 2016
1 parent 708a97d commit c737a19
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ based on _prefix_ in addition to globs. This means that a filter like

### Bugfixes
- [#921](https://github.com/influxdata/telegraf/pull/921): mqtt_consumer stops gathering metrics. Thanks @chaton78!
- [#1013](https://github.com/influxdata/telegraf/pull/1013): Close dead riemann output connections. Thanks @echupriyanov!

## v0.12.1 [2016-04-14]

Expand Down
11 changes: 2 additions & 9 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",
senderr)
}
return fmt.Errorf("FAILED to send riemann message (will try to reconnect). Error: %s\n",
senderr)
}

return nil
Expand Down

0 comments on commit c737a19

Please sign in to comment.