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

Make exporting the average of data points optional #204

Open
dudicoco opened this issue Jul 15, 2020 · 2 comments
Open

Make exporting the average of data points optional #204

dudicoco opened this issue Jul 15, 2020 · 2 comments

Comments

@dudicoco
Copy link

Currently, if you you use average statistics, YACE will export the average of all data points: https://github.com/ivx/yet-another-cloudwatch-exporter/blob/master/aws_cloudwatch.go#L731

I suggest making this optional with a flag and document the behaviour in the readme.

@cristiangreco
Copy link
Contributor

Closing this as it seems to refer to a really old version of yace. If you can still reproduce the issue with the latest realease please feel free to reopen.

@nhinds
Copy link
Contributor

nhinds commented May 7, 2023

discovery jobs now use GetMetricData which uses the result from AWS directly in migrate.go, but static jobs still use `GetMetricStatistics and will calculate the average of averages. It seems this is only partially fixed.

e.g. the following config with a discovery and static job targeting the same bucket will return the same data for aws_s3_bucket_size_bytes_maximum and aws_s3_bucket_size_bytes_minimum, but different data for aws_s3_bucket_size_bytes_average (assuming the bucket size has changed in the past 3 days):

apiVersion: v1alpha1
discovery:
  jobs:
  - type: s3
    regions:
    - ap-southeast-2
    metrics:
    - name: BucketSizeBytes
      statistics:
      - Average
      - Maximum
      - Minimum
      period: 86400
      length: 259200
static:
- namespace: AWS/S3
  name: static_s3
  regions:
  - ap-southeast-2
  dimensions:
  - name: BucketName
    value: your-bucket-name-here
  - name: StorageType
    value: StandardStorage
  metrics:
  - name: BucketSizeBytes
    statistics:
    - Average
    - Maximum
    - Minimum
    period: 86400
    length: 259200
# HELP aws_s3_bucket_size_bytes_average Help is not implemented yet.
# TYPE aws_s3_bucket_size_bytes_average gauge
aws_s3_bucket_size_bytes_average{account_id="1234567890",dimension_BucketName="your-bucket-name-here",dimension_StorageType="StandardStorage",name="arn:aws:s3:::your-bucket-name-here",region="ap-southeast-2"} 1.084161955e+09
aws_s3_bucket_size_bytes_average{account_id="1234567890",dimension_BucketName="your-bucket-name-here",dimension_StorageType="StandardStorage",name="static_s3",region="ap-southeast-2"} 1.0838232955e+09
# HELP aws_s3_bucket_size_bytes_maximum Help is not implemented yet.
# TYPE aws_s3_bucket_size_bytes_maximum gauge
aws_s3_bucket_size_bytes_maximum{account_id="1234567890",dimension_BucketName="your-bucket-name-here",dimension_StorageType="StandardStorage",name="arn:aws:s3:::your-bucket-name-here",region="ap-southeast-2"} 1.084161955e+09
aws_s3_bucket_size_bytes_maximum{account_id="1234567890",dimension_BucketName="your-bucket-name-here",dimension_StorageType="StandardStorage",name="static_s3",region="ap-southeast-2"} 1.084161955e+09
# HELP aws_s3_bucket_size_bytes_minimum Help is not implemented yet.
# TYPE aws_s3_bucket_size_bytes_minimum gauge
aws_s3_bucket_size_bytes_minimum{account_id="1234567890",dimension_BucketName="your-bucket-name-here",dimension_StorageType="StandardStorage",name="arn:aws:s3:::your-bucket-name-here",region="ap-southeast-2"} 1.084161955e+09
aws_s3_bucket_size_bytes_minimum{account_id="1234567890",dimension_BucketName="your-bucket-name-here",dimension_StorageType="StandardStorage",name="static_s3",region="ap-southeast-2"} 1.084161955e+09

(I would reopen but I can't do so here)

@cristiangreco cristiangreco reopened this Jun 27, 2023
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

No branches or pull requests

3 participants