Skip to content

Commit

Permalink
Add panic logging for metric.Fields
Browse files Browse the repository at this point in the history
  • Loading branch information
danielnelson committed Jul 10, 2017
1 parent 46db92a commit 5a56291
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions metric/metric.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,12 @@ func (m *metric) Split(maxSize int) []telegraf.Metric {
}

func (m *metric) Fields() map[string]interface{} {
defer func() {
if r := recover(); r != nil {
panic(fmt.Sprintf("Recovered in metric.Fields(); m.fields: %q\n", m.fields))
}
}()

fieldMap := map[string]interface{}{}
i := 0
for {
Expand Down

0 comments on commit 5a56291

Please sign in to comment.