AWS 警报表达式指标触发 ECS Auto Scale 策略时间 + cpu 利用率未触发

时间:2021-07-31 02:21:47

标签: amazon-web-services amazon-cloudwatch cloudwatch-alarms

预期效果:在 UTC 时间 23 点之后和 11 点之前缩减实例和 CPU。

警报图表看起来正确,但没有触发警报。阈值 >= 1,但它只会随机标记,大多数情况下根本不会。

{
    "metrics": [
        [ "AWS/ECS", "CPUUtilization", "ClusterName", "fargate-test", "ServiceName", "api", { "stat": "Average", "id": "cpu", "visible": false } ],       
        [ { "id": "scale_down_hours_cpu", "label": "scale-down-hours-cpu", "expression": "(IF(HOUR(cpu) < 11, 1, 0) OR IF(HOUR(cpu) >= 23, 1, 0)) AND IF(cpu <= 10, 1, 0)", "visible": true } ],
        [ { "id": "scale_down_cpu", "label": "scale-down-cpu", "expression": "IF(cpu < 10, 1, 0)", "visible": false } ]
    ],
    "view": "timeSeries",
    "stacked": false,
    "period": 60,
    "region": "us-east-1"
}

此处显示了所需的触发事件 <11 >=23 UTC

enter image description here

enter image description here

这些时间的cpu利用率为1%

enter image description here

有时它有效(我将其更改为 10 分),但我不明白为什么: enter image description here

0 个答案:

没有答案