Skip to content

[BUG] YACE internal metrics does not reflect actual GetMetricData API usage costs #1806

Description

@donatasjocas

Is there an existing issue for this?

  • I have searched the existing issues

YACE version

0.62.1

Config file

apiVersion: v1alpha1
sts-region: eu-central-1
discovery:
exportedTagsOnMetrics:
AWS/EBS:
- Name
jobs:

  • type: AWS/EBS
    regions:
    • eu-central-1
      period: 300
      length: 300
      delay: 300
      nilToZero: true
      addCloudwatchTimestamp: true
      recentlyActiveOnly: true
      roles:
    • roleArn: "arn:aws:iam::************:role/MetricsCollectorRole"
      statistics: [Minimum,Maximum,Average,Sum,SampleCount]
      metrics:
    • name: VolumeReadBytes
    • name: VolumeWriteBytes
    • name: VolumeReadOps
    • name: VolumeWriteOps
    • name: VolumeTotalReadTime
    • name: VolumeTotalWriteTime
    • name: VolumeIdleTime
    • name: VolumeQueueLength
    • name: VolumeThroughputPercentage
    • name: VolumeConsumedReadWriteOps
    • name: BurstBalance

Current Behavior

YACE internal metrics are inconsistent when it comes to actual GetMetricData API usage and associated costs.

It seems that right now internal metric yace_cloudwatch_getmetricdata_metrics_requested_total accounts for all metric/statistic combination on the export side while "metrics requested" in AWS terms should only include single metric requested (I assume up to 5 statistics as described in CloudWatch -> Metrics documentation)

Right now when using AWS Pricing Calculator for CloudWatch API costs with YACE internal metrics of yace_cloudwatch_requests_total and yace_cloudwatch_getmetricdata_metrics_requested_total results in completely off numbers that are incomparable with actual API costs.

I've build a test case in my AWS account proving this - when exporting only single statistic (Average), YACE metrics around API usage were in-line with the actual costs when put into Pricing Calculator. When I ran same exporter, but requesting 5 statistics metric yace_cloudwatch_getmetricdata_metrics_requested_total increased by a large number while the actual costs of GetMetricData API remained the same as if I were requesting 1 statistic for EBS metrics

Expected Behavior

YACE internal metric yace_cloudwatch_getmetricdata_metrics_requested_total should result with number that accounts for actual API usage costs according to pricing.

Steps To Reproduce

  1. Run YACE discovery scrape requesting 1 statistic for each metric;
  2. Check the internal metric yace_cloudwatch_getmetricdata_metrics_requested_total and actual costs of GetMetricData API
  3. Run YACE discovery job requesting 5 statistics for each metric;
  4. Check the internal metric yace_cloudwatch_getmetricdata_metrics_requested_total and actual costs of GetMetricData API
  5. Compare results from step 2 and 4 to see that metric value does not stand correctly for how AWS bills the API usage

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions