diff --git a/plugins/inputs/statsd/statsd.go b/plugins/inputs/statsd/statsd.go index 555f6d45b02c9..eb02a1df220db 100644 --- a/plugins/inputs/statsd/statsd.go +++ b/plugins/inputs/statsd/statsd.go @@ -24,7 +24,8 @@ const ( defaultFieldName = "value" - defaultSeparator = "_" + defaultSeparator = "_" + defaultAllowPendingMessage = 10000 ) var dropwarn = "ERROR: statsd message queue full. " + @@ -297,7 +298,7 @@ func (s *Statsd) udpListen() error { case s.in <- bufCopy: default: s.drops++ - if s.drops == 1 || s.drops%s.AllowedPendingMessages == 0 { + if s.drops == 1 || s.AllowedPendingMessages == 0 || s.drops%s.AllowedPendingMessages == 0 { log.Printf(dropwarn, s.drops) } } @@ -650,7 +651,8 @@ func (s *Statsd) Stop() { func init() { inputs.Add("statsd", func() telegraf.Input { return &Statsd{ - MetricSeparator: "_", + MetricSeparator: "_", + AllowedPendingMessages: defaultAllowPendingMessage, } }) }