-
Notifications
You must be signed in to change notification settings - Fork 0
Dashboards PromQL and Alerts zh CN
导入 dashboards/grafana/aws-cost-exporter.json,将 DS_PROMETHEUS 绑定到抓取 Exporter 的 Prometheus 数据源。内置 Dashboard 提供 target、provider、basis、currency 选择器,不依赖额外插件。
保留所有会计维度:
sum by (target, provider, cost_basis, currency) (
aws_cost_month_to_date_amount
)
Service 分组:
topk(10,
sum by (target, provider, cost_basis, currency, aws_service) (
aws_cost_service_month_to_date_amount
)
)
不要直接使用 sum(aws_cost_month_to_date_amount),它会把不同账户、currency、provider 和不兼容 basis 混在一起。
Forecast 包含今天,MTD 也已经包含今天的累计值,需要避免重复:
aws_cost_month_to_date_amount
- aws_cost_daily_amount
+ aws_cost_month_forecast_mean_amount
三个指标必须匹配同一组 target、provider、cost_basis、currency。
aws_cost_exporter_collector_up == 0
time() - aws_cost_exporter_last_success_timestamp_seconds
increase(aws_cost_exporter_pagination_pages_total[1h]) > 100
rules/prometheus/aws-cost-exporter.rules.yaml 包含 Collector 失败、Cache stale、分页突增、持续限流、overflow 和 shutdown timeout。告警分组和 annotation 应保留 target,金额告警还必须保留 currency、provider、basis。
AWS 成本数据可能延迟或 backfill。Daily gauge 在 Prometheus 中形成的是当前 UTC 账单日数值的 scrape 历史,不是 Cost Explorer 的历史每日明细表。
AWS Cost Exporter current stable v1.0.0 · Source repository · Generated from docs/wiki on master; do not edit the published Wiki directly. / 当前稳定版 v1.0.0;文档由 master 分支的 docs/wiki 自动生成,请勿直接编辑已发布 Wiki。