diff --git a/plugins/inputs/cloudwatch/README.md b/plugins/inputs/cloudwatch/README.md index 83b4b1de0..88a5b098f 100644 --- a/plugins/inputs/cloudwatch/README.md +++ b/plugins/inputs/cloudwatch/README.md @@ -68,7 +68,9 @@ API endpoint. In the following order the plugin will attempt to authenticate. [[inputs.cloudwatch.metrics]] names = ["Latency", "RequestCount"] - ## Dimension filters for Metric (optional) + ## Dimension filters for Metric. These are optional however all dimensions + ## defined for the metric names must be specified in order to retrieve + ## the metric statistics. [[inputs.cloudwatch.metrics.dimensions]] name = "LoadBalancerName" value = "p-example" @@ -142,6 +144,20 @@ Tag Dimension names are represented in [snake case](https://en.wikipedia.org/wik - unit (CloudWatch Metric Unit) - {dimension-name} (Cloudwatch Dimension value - one for each metric dimension) +### Troubleshooting: + +You can use the aws cli to get a list of available metrics and dimensions: +``` +aws cloudwatch list-metrics --namespace AWS/EC2 --region us-east-1 +aws cloudwatch list-metrics --namespace AWS/EC2 --region us-east-1 --metric-name CPUCreditBalance +``` + +If the expected metrics are not returned, you can try getting them manually +for a short period of time: +``` +aws cloudwatch get-metric-statistics --namespace AWS/EC2 --region us-east-1 --period 300 --start-time 2018-07-01T00:00:00Z --end-time 2018-07-01T00:15:00Z --statistics Average --metric-name CPUCreditBalance --dimensions Name=InstanceId,Value=i-deadbeef +``` + ### Example Output: ``` diff --git a/plugins/inputs/cloudwatch/cloudwatch.go b/plugins/inputs/cloudwatch/cloudwatch.go index 2fac94ad8..b4f91f745 100644 --- a/plugins/inputs/cloudwatch/cloudwatch.go +++ b/plugins/inputs/cloudwatch/cloudwatch.go @@ -115,7 +115,9 @@ func (c *CloudWatch) SampleConfig() string { #[[inputs.cloudwatch.metrics]] # names = ["Latency", "RequestCount"] # - # ## Dimension filters for Metric (optional) + # ## Dimension filters for Metric. These are optional however all dimensions + # ## defined for the metric names must be specified in order to retrieve + # ## the metric statistics. # [[inputs.cloudwatch.metrics.dimensions]] # name = "LoadBalancerName" # value = "p-example"