API 用于实时监控 AWS lambda 和其他实例定价?

API for monitoring AWS lambda and other instances pricing in real time?

我正在寻找一种编程方式来实时或 x 小时追溯监控我的 lambda 无服务器环境成本。我正在查看预算 API,但它似乎总是围绕一个确定的预算进行,这不是我的用例。我认为可能有效的另一种方法是计算 lambda 执行次数并根据 lambda 实例类型进行计算。任何以编程方式进行此操作的见解或方向将不胜感激。

来自Using the AWS Cost Explorer API - AWS Billing and Cost Management

The Cost Explorer API allows you to programmatically query your cost and usage data. You can query for aggregated data such as total monthly costs or total daily usage. You can also query for granular data, such as the number of daily write operations for DynamoDB database tables in your production environment.

Cost Explorer 至少每 24 小时刷新一次您的成本数据,因此它不是“实时”的。