nerdswords / yet-another-cloudwatch-exporter

Prometheus exporter for AWS CloudWatch - Discovers services through AWS tags, gets CloudWatch metrics data and provides them as Prometheus metrics with AWS tags as labels
Apache License 2.0
980 stars 334 forks source link

Feature Request: Metric Math support #138

Open arunderwood opened 4 years ago

arunderwood commented 4 years ago

Now that GetMetricData calls are supported, have you given thought to supporting Metric Math? I ask because certain AWS account information can only be retrieved via metric math.

For instance, if I want to export the used percentage of my KMS:DescribeKey quota, I need to call the function SERVICE_QUOTA() on the KMS:DescribeKey metric. To illustrate this, here is a description of a CloudWatch Dashboard that displays the metric:

{
    "metrics": [
        [ { "expression": "100 * m1 / SERVICE_QUOTA(m1)", "label": "Utilization %", "id": "e1", "region": "us-east-1" } ],
        [ "AWS/Usage", "CallCount", "Resource", "DescribeKey", "Service", "KMS", "Type", "API", "Class", "None", { "id": "m1", "visible": false } ]
    ],
    "period": 1,
    "units": "None",
    "stat": "Sum",
    "view": "timeSeries",
    "stacked": false,
    "title": "DescribeKey request rate - (Utilization %)",
    "region": "us-east-1"
}
z0rc commented 2 months ago

One more data point. Metric Math has DB_PERF_INSIGHTS that allows to extract Performance Insights metrics, which opens an entirely new namespace of metrics.

Though this would also require autodiscovery of RDS identifiers, as function expects it as parameter.

Screenshot 2024-08-13 at 21 10 59