Compare commits

...

5 Commits

Author SHA1 Message Date
John Engelman
8ecfe13bf8 Update docs on Cloudwatch. Set default period to 5m. (#2000) 2016-11-07 12:14:55 +00:00
John Engelman
a90a687d89 Fix up AWS plugin docs so they don't use single quotes. (#1991)
Also don't use named returns in fetchNamespaceMetrics since it's
non-standard for the rest of the codebase.
2016-11-04 13:19:41 +00:00
Cameron Sparr
5ef6fe1d85 Update etc/telegraf.conf 2016-11-04 13:19:32 +00:00
Cameron Sparr
f9aef06a3c CircleCI script, do not explicitly set version tag 2016-11-03 17:07:25 +00:00
Cameron Sparr
105bb65f73 Add release 1.2 section to changelog 2016-11-03 17:01:53 +00:00
6 changed files with 64 additions and 45 deletions

View File

@@ -1,3 +1,11 @@
## v1.2 [unreleased]
### Release Notes
### Features
### Bugfixes
## v1.1 [unreleased] ## v1.1 [unreleased]
### Release Notes ### Release Notes

View File

@@ -160,7 +160,7 @@
# # Configuration for AWS CloudWatch output. # # Configuration for AWS CloudWatch output.
# [[outputs.cloudwatch]] # [[outputs.cloudwatch]]
# ## Amazon REGION # ## Amazon REGION
# region = 'us-east-1' # region = "us-east-1"
# #
# ## Amazon Credentials # ## Amazon Credentials
# ## Credentials are loaded in the following order # ## Credentials are loaded in the following order
@@ -178,7 +178,7 @@
# #shared_credential_file = "" # #shared_credential_file = ""
# #
# ## Namespace for the CloudWatch MetricDatums # ## Namespace for the CloudWatch MetricDatums
# namespace = 'InfluxData/Telegraf' # namespace = "InfluxData/Telegraf"
# # Configuration for DataDog API to send metrics to. # # Configuration for DataDog API to send metrics to.
@@ -623,7 +623,7 @@
# # Pull Metric Statistics from Amazon CloudWatch # # Pull Metric Statistics from Amazon CloudWatch
# [[inputs.cloudwatch]] # [[inputs.cloudwatch]]
# ## Amazon Region # ## Amazon Region
# region = 'us-east-1' # region = "us-east-1"
# #
# ## Amazon Credentials # ## Amazon Credentials
# ## Credentials are loaded in the following order # ## Credentials are loaded in the following order
@@ -641,21 +641,21 @@
# #shared_credential_file = "" # #shared_credential_file = ""
# #
# ## Requested CloudWatch aggregation Period (required - must be a multiple of 60s) # ## Requested CloudWatch aggregation Period (required - must be a multiple of 60s)
# period = '1m' # period = "5m"
# #
# ## Collection Delay (required - must account for metrics availability via CloudWatch API) # ## Collection Delay (required - must account for metrics availability via CloudWatch API)
# delay = '1m' # delay = "5m"
# #
# ## Recomended: use metric 'interval' that is a multiple of 'period' to avoid # ## Recomended: use metric 'interval' that is a multiple of 'period' to avoid
# ## gaps or overlap in pulled data # ## gaps or overlap in pulled data
# interval = '1m' # interval = "5m"
# #
# ## Configure the TTL for the internal cache of metrics. # ## Configure the TTL for the internal cache of metrics.
# ## Defaults to 1 hr if not specified # ## Defaults to 1 hr if not specified
# #cache_ttl = '10m' # #cache_ttl = "10m"
# #
# ## Metric Statistic Namespace (required) # ## Metric Statistic Namespace (required)
# namespace = 'AWS/ELB' # namespace = "AWS/ELB"
# #
# ## Maximum requests per second. Note that the global default AWS rate limit is # ## 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 # ## 10 reqs/sec, so if you define multiple namespaces, these should add up to a
@@ -666,12 +666,12 @@
# ## Defaults to all Metrics in Namespace if nothing is provided # ## Defaults to all Metrics in Namespace if nothing is provided
# ## Refreshes Namespace available metrics every 1h # ## Refreshes Namespace available metrics every 1h
# #[[inputs.cloudwatch.metrics]] # #[[inputs.cloudwatch.metrics]]
# # names = ['Latency', 'RequestCount'] # # names = ["Latency", "RequestCount"]
# # # #
# # ## Dimension filters for Metric (optional) # # ## Dimension filters for Metric (optional)
# # [[inputs.cloudwatch.metrics.dimensions]] # # [[inputs.cloudwatch.metrics.dimensions]]
# # name = 'LoadBalancerName' # # name = "LoadBalancerName"
# # value = 'p-example' # # value = "p-example"
# # Gather health check statuses from services registered in Consul # # Gather health check statuses from services registered in Consul
@@ -1979,4 +1979,3 @@
# #
# [inputs.webhooks.rollbar] # [inputs.webhooks.rollbar]
# path = "/rollbar" # path = "/rollbar"

View File

@@ -18,21 +18,28 @@ API endpoint. In the following order the plugin will attempt to authenticate.
```toml ```toml
[[inputs.cloudwatch]] [[inputs.cloudwatch]]
## Amazon Region (required) ## Amazon Region (required)
region = 'us-east-1' region = "us-east-1"
# The minimum period for Cloudwatch metrics is 1 minute (60s). However not all
# metrics are made available to the 1 minute period. Some are collected at
# 3 minute and 5 minutes intervals. See https://aws.amazon.com/cloudwatch/faqs/#monitoring.
# Note that if a period is configured that is smaller than the minimum for a
# particular metric, that metric will not be returned by the Cloudwatch API
# and will not be collected by Telegraf.
#
## Requested CloudWatch aggregation Period (required - must be a multiple of 60s) ## Requested CloudWatch aggregation Period (required - must be a multiple of 60s)
period = '1m' period = "5m"
## Collection Delay (required - must account for metrics availability via CloudWatch API) ## Collection Delay (required - must account for metrics availability via CloudWatch API)
delay = '1m' delay = "5m"
## Override global run interval (optional - defaults to global interval) ## Override global run interval (optional - defaults to global interval)
## Recomended: use metric 'interval' that is a multiple of 'period' to avoid ## Recomended: use metric 'interval' that is a multiple of 'period' to avoid
## gaps or overlap in pulled data ## gaps or overlap in pulled data
interval = '1m' interval = "5m"
## Metric Statistic Namespace (required) ## Metric Statistic Namespace (required)
namespace = 'AWS/ELB' namespace = "AWS/ELB"
## Maximum requests per second. Note that the global default AWS rate limit is ## 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 ## 10 reqs/sec, so if you define multiple namespaces, these should add up to a
@@ -43,16 +50,16 @@ API endpoint. In the following order the plugin will attempt to authenticate.
## Defaults to all Metrics in Namespace if nothing is provided ## Defaults to all Metrics in Namespace if nothing is provided
## Refreshes Namespace available metrics every 1h ## Refreshes Namespace available metrics every 1h
[[inputs.cloudwatch.metrics]] [[inputs.cloudwatch.metrics]]
names = ['Latency', 'RequestCount'] names = ["Latency", "RequestCount"]
## Dimension filters for Metric (optional) ## Dimension filters for Metric (optional)
[[inputs.cloudwatch.metrics.dimensions]] [[inputs.cloudwatch.metrics.dimensions]]
name = 'LoadBalancerName' name = "LoadBalancerName"
value = 'p-example' value = "p-example"
[[inputs.cloudwatch.metrics.dimensions]] [[inputs.cloudwatch.metrics.dimensions]]
name = 'AvailabilityZone' name = "AvailabilityZone"
value = '*' value = "*"
``` ```
#### Requirements and Terminology #### Requirements and Terminology
@@ -71,16 +78,16 @@ wildcard dimension is ignored.
Example: Example:
``` ```
[[inputs.cloudwatch.metrics]] [[inputs.cloudwatch.metrics]]
names = ['Latency'] names = ["Latency"]
## Dimension filters for Metric (optional) ## Dimension filters for Metric (optional)
[[inputs.cloudwatch.metrics.dimensions]] [[inputs.cloudwatch.metrics.dimensions]]
name = 'LoadBalancerName' name = "LoadBalancerName"
value = 'p-example' value = "p-example"
[[inputs.cloudwatch.metrics.dimensions]] [[inputs.cloudwatch.metrics.dimensions]]
name = 'AvailabilityZone' name = "AvailabilityZone"
value = '*' value = "*"
``` ```
If the following ELBs are available: If the following ELBs are available:

View File

@@ -63,7 +63,7 @@ type (
func (c *CloudWatch) SampleConfig() string { func (c *CloudWatch) SampleConfig() string {
return ` return `
## Amazon Region ## Amazon Region
region = 'us-east-1' region = "us-east-1"
## Amazon Credentials ## Amazon Credentials
## Credentials are loaded in the following order ## Credentials are loaded in the following order
@@ -80,22 +80,29 @@ func (c *CloudWatch) SampleConfig() string {
#profile = "" #profile = ""
#shared_credential_file = "" #shared_credential_file = ""
# The minimum period for Cloudwatch metrics is 1 minute (60s). However not all
# metrics are made available to the 1 minute period. Some are collected at
# 3 minute and 5 minutes intervals. See https://aws.amazon.com/cloudwatch/faqs/#monitoring.
# Note that if a period is configured that is smaller than the minimum for a
# particular metric, that metric will not be returned by the Cloudwatch API
# and will not be collected by Telegraf.
#
## Requested CloudWatch aggregation Period (required - must be a multiple of 60s) ## Requested CloudWatch aggregation Period (required - must be a multiple of 60s)
period = '1m' period = "5m"
## Collection Delay (required - must account for metrics availability via CloudWatch API) ## Collection Delay (required - must account for metrics availability via CloudWatch API)
delay = '1m' delay = "5m"
## Recomended: use metric 'interval' that is a multiple of 'period' to avoid ## Recomended: use metric 'interval' that is a multiple of 'period' to avoid
## gaps or overlap in pulled data ## gaps or overlap in pulled data
interval = '1m' interval = "5m"
## Configure the TTL for the internal cache of metrics. ## Configure the TTL for the internal cache of metrics.
## Defaults to 1 hr if not specified ## Defaults to 1 hr if not specified
#cache_ttl = '10m' #cache_ttl = "10m"
## Metric Statistic Namespace (required) ## Metric Statistic Namespace (required)
namespace = 'AWS/ELB' namespace = "AWS/ELB"
## Maximum requests per second. Note that the global default AWS rate limit is ## 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 ## 10 reqs/sec, so if you define multiple namespaces, these should add up to a
@@ -106,12 +113,12 @@ func (c *CloudWatch) SampleConfig() string {
## Defaults to all Metrics in Namespace if nothing is provided ## Defaults to all Metrics in Namespace if nothing is provided
## Refreshes Namespace available metrics every 1h ## Refreshes Namespace available metrics every 1h
#[[inputs.cloudwatch.metrics]] #[[inputs.cloudwatch.metrics]]
# names = ['Latency', 'RequestCount'] # names = ["Latency", "RequestCount"]
# #
# ## Dimension filters for Metric (optional) # ## Dimension filters for Metric (optional)
# [[inputs.cloudwatch.metrics.dimensions]] # [[inputs.cloudwatch.metrics.dimensions]]
# name = 'LoadBalancerName' # name = "LoadBalancerName"
# value = 'p-example' # value = "p-example"
` `
} }
@@ -133,7 +140,6 @@ func (c *CloudWatch) Gather(acc telegraf.Accumulator) error {
if !hasWilcard(m.Dimensions) { if !hasWilcard(m.Dimensions) {
dimensions := make([]*cloudwatch.Dimension, len(m.Dimensions)) dimensions := make([]*cloudwatch.Dimension, len(m.Dimensions))
for k, d := range m.Dimensions { for k, d := range m.Dimensions {
fmt.Printf("Dimension [%s]:[%s]\n", d.Name, d.Value)
dimensions[k] = &cloudwatch.Dimension{ dimensions[k] = &cloudwatch.Dimension{
Name: aws.String(d.Name), Name: aws.String(d.Name),
Value: aws.String(d.Value), Value: aws.String(d.Value),
@@ -229,13 +235,12 @@ func (c *CloudWatch) initializeCloudWatch() error {
/* /*
* Fetch available metrics for given CloudWatch Namespace * Fetch available metrics for given CloudWatch Namespace
*/ */
func (c *CloudWatch) fetchNamespaceMetrics() (metrics []*cloudwatch.Metric, err error) { func (c *CloudWatch) fetchNamespaceMetrics() ([]*cloudwatch.Metric, error) {
if c.metricCache != nil && c.metricCache.IsValid() { if c.metricCache != nil && c.metricCache.IsValid() {
metrics = c.metricCache.Metrics return c.metricCache.Metrics, nil
return
} }
metrics = []*cloudwatch.Metric{} metrics := []*cloudwatch.Metric{}
var token *string var token *string
for more := true; more; { for more := true; more; {
@@ -263,7 +268,7 @@ func (c *CloudWatch) fetchNamespaceMetrics() (metrics []*cloudwatch.Metric, err
TTL: c.CacheTTL.Duration, TTL: c.CacheTTL.Duration,
} }
return return metrics, nil
} }
/* /*

View File

@@ -30,7 +30,7 @@ type CloudWatch struct {
var sampleConfig = ` var sampleConfig = `
## Amazon REGION ## Amazon REGION
region = 'us-east-1' region = "us-east-1"
## Amazon Credentials ## Amazon Credentials
## Credentials are loaded in the following order ## Credentials are loaded in the following order
@@ -48,7 +48,7 @@ var sampleConfig = `
#shared_credential_file = "" #shared_credential_file = ""
## Namespace for the CloudWatch MetricDatums ## Namespace for the CloudWatch MetricDatums
namespace = 'InfluxData/Telegraf' namespace = "InfluxData/Telegraf"
` `
func (c *CloudWatch) SampleConfig() string { func (c *CloudWatch) SampleConfig() string {

View File

@@ -82,6 +82,6 @@ if [ $? -eq 0 ]; then
unset GOGC unset GOGC
tag=$(git describe --exact-match HEAD) tag=$(git describe --exact-match HEAD)
echo $tag echo $tag
exit_if_fail ./scripts/build.py --release --package --version=$tag --platform=all --arch=all --upload --bucket=dl.influxdata.com/telegraf/releases exit_if_fail ./scripts/build.py --release --package --platform=all --arch=all --upload --bucket=dl.influxdata.com/telegraf/releases
mv build $CIRCLE_ARTIFACTS mv build $CIRCLE_ARTIFACTS
fi fi