基于2个队列的自动策略?

发布于 2025-01-28 00:27:00 字数 483 浏览 3 评论 0原文

我设法设置了一个警报/自动策略,该策略根据SQS队列中的消息触发。但是,我有2个队列与此过程不可或缺的一部分 - 仅当两个队列满足触发要求时,我才需要警报才能触发。因此,这样的事情:

resource "aws_cloudwatch_metric_alarm" "messages_not_visible" {
  alarm_name          = "q1"
  comparison_operator = "LessThanThreshold"
  ...
  dimensions = {
    QueueName = "q1.fifo", "q2.fifo"
  }
  alarm_actions = [aws_appautoscaling_policy.scale_down_policy.arn]
}

这显然会出现,因为它只接受了字符串。我尝试为这两个队列发出2个单独的警报,但我不希望我的EC缩放两次,因为它触发了2次。只有当两个触发器都满足时。我在这里做什么?

I managed to set an alarm/autoscaling policy that triggers based on messages in an SQS queue. However, I have 2 queues integral to this process - I need my alarm to trigger only when BOTH of the queues meet the trigger requirements. So something like this:

resource "aws_cloudwatch_metric_alarm" "messages_not_visible" {
  alarm_name          = "q1"
  comparison_operator = "LessThanThreshold"
  ...
  dimensions = {
    QueueName = "q1.fifo", "q2.fifo"
  }
  alarm_actions = [aws_appautoscaling_policy.scale_down_policy.arn]
}

This obviously errors out, as it only accepts a string. I tried making 2 separate alarms for those 2 queues, but I don't want my ECS to be scaled down twice because it triggers 2 times. Only when both of the triggers are satisfied. What do I do here?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦醒灬来后我 2025-02-04 00:27:00

您需要使用“ nofollow noreferrer”> CloudWatch公制数学创建一个基于多个度量的警报。

You'll need to use CloudWatch Metric Math to create an alarm that is based on more than one metric.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文