Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix how the metricRequestedForBilling is counted to use queries.size() #741

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

emmanuelperotto
Copy link

@emmanuelperotto emmanuelperotto commented Sep 10, 2024

This change fixes how the exporter counts the metrics that will be billed for the GetMetricData request.

The YACE already fixed this in their implementation as seen here: https://github.com/nerdswords/yet-another-cloudwatch-exporter/blob/master/pkg/clients/cloudwatch/v2/client.go#L117

image

EXAMPLE

MetricDataQueries=[
        {
            'Id': 'foo',
            'MetricStat': {
                'Metric': {
                    'Namespace': 'AWS/DynamoDB',
                    'MetricName': 'ConsumedWriteCapacityUnits',
                    'Dimensions': [
                        {'Name': 'TableName',
                         'Value': 'one-table'}
                    ]
                },
                'Period': 300,   # 5 minutes
                'Stat': 'Sum',
                'Unit': 'Count'
            },
            'ReturnData': True,
        },
        {
            'Id': 'bar',
            'MetricStat': {
                'Metric': {
                    'Namespace': 'AWS/DynamoDB',
                    'MetricName': 'ConsumedWriteCapacityUnits',
                    'Dimensions': [
                        {'Name': 'TableName',
                         'Value': 'another-table'}
                    ]
                },
                'Period': 300,   # 5 minutes
                'Stat': 'Sum',
                'Unit': 'Count'
            },
            'ReturnData': True,
        }
    ]

For this scenario YACE would increase 2 to the counter metric while this exporter would increase by 1 only

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant