# Unexpectedly High Hourly Usage of CW:GMD-Metrics with AWS Module

**URL:** <https://discuss.elastic.co/t/unexpectedly-high-hourly-usage-of-cw-gmd-metrics-with-aws-module/221594>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [March 1, 2020, 7:32pm UTC](https://discuss.elastic.co/t/unexpectedly-high-hourly-usage-of-cw-gmd-metrics-with-aws-module/221594 "2020-03-01T19:32:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![AddChickpeas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/addchickpeas/32/44414_2.png) [@AddChickpeas](https://discuss.elastic.co/u/AddChickpeas)\
**Post date:** [March 1, 2020, 7:32pm UTC](https://discuss.elastic.co/t/unexpectedly-high-hourly-usage-of-cw-gmd-metrics-with-aws-module/221594/1 "2020-03-01T19:32:54Z")

</div>

Hello,

I'm trying to make sense of the CW:GMD-Metrics usage from my usage report. It currently is indicating it is using 10k metrics every hour, but I have no idea where that number is coming from. Looks farther back in the report, there are some points it was using 21k metrics.

These seem like what I would expect if it was pulling all metrics in the namespaces I'm working with.

| Service | Operation | UsageType | Resource | StartTime | EndTime | UsageValue |
| --- | --- | --- | --- | --- | --- | --- |
| AmazonCloudWatch | GetMetricData | CW:GMD-Metrics | | 3/1/2020 10:00 | 3/1/2020 11:00 | 10560 |
| AmazonCloudWatch | GetMetricData | CW:GMD-Requests | | 3/1/2020 10:00 | 3/1/2020 11:00 | 240 |

For context, there are 13 APIs and 6 DynamoDB tables data is being pulled from. If I understand how GMD is charged correctly, this should only come out to 2280 metrics/hr. I'm using at least 5x that.

Config:

```
 metricbeat.modules:       
    - module: aws
      period: 60s
      access_key_id: '${AWS_ACCESS_KEY_ID_DATAPRE}'
      secret_access_key: '${AWS_SECRET_ACCESS_KEY_DATAPRE}'
      tags: ["pre"]
      metricsets:
        - cloudwatch
      metrics:
        - namespace: AWS/ApiGateway          
          name: ["Latency", "IntegrationLatency"]
          statistic: ["Average", "Sum"]     
      region:
        - us-east-1  
    - module: aws
      period: 60s
      access_key_id: '${AWS_ACCESS_KEY_ID_DATAPRE}'
      secret_access_key: '${AWS_SECRET_ACCESS_KEY_DATAPRE}'      
      metricsets:
        - cloudwatch
      metrics:        
        - namespace: AWS/DynamoDB
          name: ["ConsumedReadCapacityUnits", "ConsumedWriteCapacityUnits"]       
          tags.resource_type_filter: dynamodb:table
          statistic: ["Average", "Sum"]  
          tags:
          - key: "Tenant"
            value: "tenant1"
```

---

<div class="post-metadata">

**Author:** ![AddChickpeas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/addchickpeas/32/44414_2.png) [@AddChickpeas](https://discuss.elastic.co/u/AddChickpeas)\
**Post date:** [March 2, 2020, 6:49pm UTC](https://discuss.elastic.co/t/unexpectedly-high-hourly-usage-of-cw-gmd-metrics-with-aws-module/221594/2 "2020-03-02T18:49:49Z")

</div>

Update:

So I modified my config to bring in more data and my usage seems to have gone down?

```
- module: aws
  period: 60s
  access_key_id: '${AWS_ACCESS_KEY_ID_DATAPRE}'
  secret_access_key: '${AWS_SECRET_ACCESS_KEY_DATAPRE}'
  tags: ["pre"]
  metricsets:
    - cloudwatch
  metrics:
    - namespace: AWS/ApiGateway
    - namespace: AWS/DynamoDB
 region: 
    - us-east-1

```

The 10,000 metrics/hr part is from the config in my original post. 21k was before I took out SQS for testing reasons.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/b/1/b1fb17c7c2cece40e9ce580fe5836fca8dda5bf4.png)

---

<div class="post-metadata">

**Author:** ![Kaiyan\_Sheng](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kaiyan_sheng/32/38247_2.png) [@Kaiyan\_Sheng](https://discuss.elastic.co/u/Kaiyan_Sheng)\
**Post date:** [March 3, 2020, 12:02am UTC](https://discuss.elastic.co/t/unexpectedly-high-hourly-usage-of-cw-gmd-metrics-with-aws-module/221594/3 "2020-03-03T00:02:32Z")

</div>

Hmm this doesn't make sense to me either. I will look into the cloudwatch metricset to see why two different config makes this big difference on GMD-Metrics. Thanks for all the info!!! Very helpful!!

I do see you are using `region: us-east-1` in the config. Are you planning to only collect metrics from `us-east-1` region? If so, the config parameter is `regions`.

---

<div class="post-metadata">

**Author:** ![AddChickpeas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/addchickpeas/32/44414_2.png) [@AddChickpeas](https://discuss.elastic.co/u/AddChickpeas)\
**Post date:** [March 3, 2020, 8:25am UTC](https://discuss.elastic.co/t/unexpectedly-high-hourly-usage-of-cw-gmd-metrics-with-aws-module/221594/4 "2020-03-03T08:25:01Z")

</div>

That would explain why it was still running list-metrics on other regions. Thanks for the tip. Let me know if you turn up anything on the cloudwatch metricset.

I'm going to be running a get-metric-data cronjob for comparison against the api gateway and dynamo metrics I was pulling before. I'll let you know how it performs metric wise in comparison.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 31, 2020, 8:25am UTC](https://discuss.elastic.co/t/unexpectedly-high-hourly-usage-of-cw-gmd-metrics-with-aws-module/221594/5 "2020-03-31T08:25:02Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
