Dashboards, PromQL and Alerts¶
Import dashboards/grafana/aws-cost-exporter.json and bind DS_PROMETHEUS to the Prometheus data source that scrapes the exporter. The bundled dashboard has target, provider, basis, and currency controls and no plugin dependency.
Safe monetary aggregation¶
Preserve all accounting dimensions:
Service breakdown:
topk(10,
sum by (target, provider, cost_basis, currency, aws_service) (
aws_cost_service_month_to_date_amount
)
)
Do not use an unqualified sum(aws_cost_month_to_date_amount): it can merge accounts, currencies, providers, and incompatible bases.
Estimated month end¶
Forecast includes today while MTD already contains today's accumulated value. Avoid double counting:
Match the same target, provider, cost_basis, and currency on all terms.
Health queries¶
Bundled alerts¶
rules/prometheus/aws-cost-exporter.rules.yaml includes collector failure, stale cache, pagination spike, sustained throttling, overflow, and shutdown-timeout signals. Keep target in alert grouping and annotations. Monetary alerts must keep currency, provider, and basis.
Billing data can arrive late and be backfilled. Daily gauges represent the current UTC billing-day value observed over Prometheus scrape history, not a historical Cost Explorer daily table.