From dcb8e3f7a6ab3b629eb446d1d5f4de2ed0bdeddd Mon Sep 17 00:00:00 2001 From: Antoine Augusti Date: Wed, 15 Mar 2017 23:20:18 +0100 Subject: [PATCH] Update default value for Cloudwatch rate limit (#2520) --- CHANGELOG.md | 1 + plugins/inputs/cloudwatch/README.md | 7 ++++--- plugins/inputs/cloudwatch/cloudwatch.go | 9 +++++---- plugins/inputs/cloudwatch/cloudwatch_test.go | 4 ++-- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 20a036555..ea1ccca4d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -79,6 +79,7 @@ be deprecated eventually. - [#2483](https://github.com/influxdata/telegraf/pull/2483): Fix win_perf_counters capping values at 100. - [#2498](https://github.com/influxdata/telegraf/pull/2498): Exporting Ipmi.Path to be set by config. - [#2500](https://github.com/influxdata/telegraf/pull/2500): Remove warning if parse empty content +- [#2520](https://github.com/influxdata/telegraf/pull/2520): Update default value for Cloudwatch rate limit - [#2513](https://github.com/influxdata/telegraf/issues/2513): create /etc/telegraf/telegraf.d directory in tarball. ## v1.2.1 [2017-02-01] diff --git a/plugins/inputs/cloudwatch/README.md b/plugins/inputs/cloudwatch/README.md index 643e18c3b..3a3c708a2 100644 --- a/plugins/inputs/cloudwatch/README.md +++ b/plugins/inputs/cloudwatch/README.md @@ -42,9 +42,10 @@ API endpoint. In the following order the plugin will attempt to authenticate. namespace = "AWS/ELB" ## Maximum requests per second. Note that the global default AWS rate limit is - ## 10 reqs/sec, so if you define multiple namespaces, these should add up to a - ## maximum of 10. Optional - default value is 10. - ratelimit = 10 + ## 400 reqs/sec, so if you define multiple namespaces, these should add up to a + ## maximum of 400. Optional - default value is 200. + ## See http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_limits.html + ratelimit = 200 ## Metrics to Pull (optional) ## Defaults to all Metrics in Namespace if nothing is provided diff --git a/plugins/inputs/cloudwatch/cloudwatch.go b/plugins/inputs/cloudwatch/cloudwatch.go index a812c1265..f0a067001 100644 --- a/plugins/inputs/cloudwatch/cloudwatch.go +++ b/plugins/inputs/cloudwatch/cloudwatch.go @@ -105,9 +105,10 @@ func (c *CloudWatch) SampleConfig() string { namespace = "AWS/ELB" ## Maximum requests per second. Note that the global default AWS rate limit is - ## 10 reqs/sec, so if you define multiple namespaces, these should add up to a - ## maximum of 10. Optional - default value is 10. - ratelimit = 10 + ## 400 reqs/sec, so if you define multiple namespaces, these should add up to a + ## maximum of 400. Optional - default value is 200. + ## See http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_limits.html + ratelimit = 200 ## Metrics to Pull (optional) ## Defaults to all Metrics in Namespace if nothing is provided @@ -214,7 +215,7 @@ func init() { ttl, _ := time.ParseDuration("1hr") return &CloudWatch{ CacheTTL: internal.Duration{Duration: ttl}, - RateLimit: 10, + RateLimit: 200, } }) } diff --git a/plugins/inputs/cloudwatch/cloudwatch_test.go b/plugins/inputs/cloudwatch/cloudwatch_test.go index a1bd7464b..f2d58a00c 100644 --- a/plugins/inputs/cloudwatch/cloudwatch_test.go +++ b/plugins/inputs/cloudwatch/cloudwatch_test.go @@ -58,7 +58,7 @@ func TestGather(t *testing.T) { Namespace: "AWS/ELB", Delay: internalDuration, Period: internalDuration, - RateLimit: 10, + RateLimit: 200, } var acc testutil.Accumulator @@ -146,7 +146,7 @@ func TestSelectMetrics(t *testing.T) { Namespace: "AWS/ELB", Delay: internalDuration, Period: internalDuration, - RateLimit: 10, + RateLimit: 200, Metrics: []*Metric{ &Metric{ MetricNames: []string{"Latency", "RequestCount"},