From cebbf392761f0d88ce2936b188011cde5e2f25c7 Mon Sep 17 00:00:00 2001 From: Cameron Sparr Date: Tue, 13 Dec 2016 16:34:52 +0000 Subject: [PATCH] Set default values for delete_ configuration options closes #1893 --- CHANGELOG.md | 5 +++++ plugins/inputs/statsd/README.md | 19 ++++++++++++------- plugins/inputs/statsd/statsd.go | 24 +++++++++++++++++------- 3 files changed, 34 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d899f90742b97..c745d462f3dfb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ### Release Notes +- The StatsD plugin will now default all "delete_" config options to "true". This +will change te default behavior for users who were not specifying these parameters +in their config file. + ### Features - [#2123](https://github.com/influxdata/telegraf/pull/2123): Fix improper calculation of CPU percentages @@ -19,6 +23,7 @@ - [#1908](https://github.com/influxdata/telegraf/pull/1908): RabbitMQ Connection metrics. - [#1937](https://github.com/influxdata/telegraf/pull/1937): HAProxy session limit metric. - [#2068](https://github.com/influxdata/telegraf/issues/2068): Accept strings for StatsD sets. +- [#1893](https://github.com/influxdata/telegraf/issues/1893): Change StatsD default "reset" behavior. ### Bugfixes diff --git a/plugins/inputs/statsd/README.md b/plugins/inputs/statsd/README.md index a17f8c888e5bd..91070419ab25c 100644 --- a/plugins/inputs/statsd/README.md +++ b/plugins/inputs/statsd/README.md @@ -7,14 +7,19 @@ [[inputs.statsd]] ## Address and port to host UDP listener on service_address = ":8125" - ## Delete gauges every interval (default=false) - delete_gauges = false - ## Delete counters every interval (default=false) - delete_counters = false - ## Delete sets every interval (default=false) - delete_sets = false - ## Delete timings & histograms every interval (default=true) + + ## The following configuration options control when telegraf clears it's cache + ## of previous values. If set to false, then telegraf will only clear it's + ## cache when the daemon is restarted. + ## Reset gauges every interval (default=true) + delete_gauges = true + ## Reset counters every interval (default=true) + delete_counters = true + ## Reset sets every interval (default=true) + delete_sets = true + ## Reset timings & histograms every interval (default=true) delete_timings = true + ## Percentiles to calculate for timing & histogram stats percentiles = [90] diff --git a/plugins/inputs/statsd/statsd.go b/plugins/inputs/statsd/statsd.go index 7591864c28a30..75dfc915ef1f5 100644 --- a/plugins/inputs/statsd/statsd.go +++ b/plugins/inputs/statsd/statsd.go @@ -136,14 +136,19 @@ func (_ *Statsd) Description() string { const sampleConfig = ` ## Address and port to host UDP listener on service_address = ":8125" - ## Delete gauges every interval (default=false) - delete_gauges = false - ## Delete counters every interval (default=false) - delete_counters = false - ## Delete sets every interval (default=false) - delete_sets = false - ## Delete timings & histograms every interval (default=true) + + ## The following configuration options control when telegraf clears it's cache + ## of previous values. If set to false, then telegraf will only clear it's + ## cache when the daemon is restarted. + ## Reset gauges every interval (default=true) + delete_gauges = true + ## Reset counters every interval (default=true) + delete_counters = true + ## Reset sets every interval (default=true) + delete_sets = true + ## Reset timings & histograms every interval (default=true) delete_timings = true + ## Percentiles to calculate for timing & histogram stats percentiles = [90] @@ -654,8 +659,13 @@ func (s *Statsd) Stop() { func init() { inputs.Add("statsd", func() telegraf.Input { return &Statsd{ + ServiceAddress: ":8125", MetricSeparator: "_", AllowedPendingMessages: defaultAllowPendingMessage, + DeleteCounters: true, + DeleteGauges: true, + DeleteSets: true, + DeleteTimings: true, } }) }