88

我正在停用 Amazon Web Services DynamoDB 中的一项服务。我们的 DyDB 表有各种指标和警报。我可以使用“aws cloudwatch delete-alarms --alarm-names ...”删除警报,但我没有看到任何用于删除指标的 AWS CLI 命令。

我知道指标将数据保留 2 周。当没有更多数据存储在其中时,指标是否有可能在 2 周内自动消失?不幸的是,我没有看到任何文件说明这一点。

4

4 回答 4

106

你是对的:没有 API 可以删除 AWS Cloudwatch 指标。在推送最后一个指标后等待两周。它会自动消失。

于 2014-04-24T08:25:43.110 回答
48

自 2016 年 11 月 1 日起,CloudWatch 已将指标(自定义和 AWS 命名空间)的保留期从之前的 14 天延长至 15 个月。

但是 CW 控制台将指标的搜索限制在最后一次摄取指标后的 2 周内(这意味着如果有一个指标在过去 14 天内没有推送任何数据点,那么 CW 控制台将不会显示它,但您仍然可以获得它使用 cli get-metric-statistics 或通过调整控制台 url 来引用正确的资源名称以及超过 14 天的开始和结束时间)。

并且没有用于删除指标的 api。 https://aws.amazon.com/cloudwatch/faqs/

于 2018-02-18T03:21:40.990 回答
3

https://aws.amazon.com/cloudwatch/faqs/

Amazon CloudWatch FAQs

[…]

Q: What is the retention period of all metrics?

CloudWatch retains metric data as follows:

  • Data points with a period of less than 60 seconds are available for 3 hours. These data points are high-resolution custom metrics.
  • Data points with a period of 60 seconds (1 minute) are available for 15 days
  • Data points with a period of 300 seconds (5 minute) are available for 63 days
  • Data points with a period of 3600 seconds (1 hour) are available for 455 days (15 months)
  • Data points that are initially published with a shorter period are aggregated together for long-term storage.

[…]

Q: Can I delete any metrics?

CloudWatch does not support metric deletion. Metrics expire based on the retention schedules described above.

于 2021-08-31T03:16:33.257 回答
0

为了支持上述内容,不幸的是,这仍然是一个问题。要阅读有关 AWS 论坛的更多信息,请参阅: https ://forums.aws.amazon.com/message.jspa?messageID=281904

于 2021-07-26T16:35:40.050 回答