amazon-web-services - AWS 警报在创建时卡在 INSUFFICIENT_DATA 中

标签 amazon-web-services amazon-cloudwatch autoscaling

我尝试创建一个 AWS 警报来监视 SQS。如果队列在 2 分钟内有超过 1 条消息,我想创建一个警报来触发策略。我使用此命令来创建警报:

aws cloudwatch put-metric-alarm --alarm-name alarmName --metric-name ApproximateNumberOfMessagesVisible --namespace "AWS/SQS" --statistic Average --period 60  --evaluation-periods 2 --threshold 1 --comparison-operator GreaterThanOrEqualToThreshold --dimensions "Name=QueueName,Value=QueueName" "Name=AutoScalingGroupName,Value=asg-name" --alarm-actions "<arn:batch-upscale-policy>" --actions-enable

我可以在 AWS 控制台中看到警报,但它停留在 INSUFFICIENT_DATA 状态。我该如何修复它?

这里我要监听其他AWS帐户中的队列。这可能吗?!

最佳答案

如果您还没有正在运行的进程轮询队列,那么您所看到的情况是正常的。您必须运行一些至少会定期轮询队列的程序,然后数据不足的情况应该会自行清除。如果队列在大约 6 小时内没有生产者或消费者,SQS 不会向 cloudwatch 发送任何内容。

The metrics you configure with CloudWatch for your Amazon SQS queues are automatically collected and pushed to CloudWatch every five minutes. These metrics are gathered on all queues that meet the CloudWatch guidelines for being active. A queue is considered active by CloudWatch for up to six hours from the last activity (i.e., any API call) on the queue.

http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/MonitorSQSwithCloudWatch.html

关于amazon-web-services - AWS 警报在创建时卡在 INSUFFICIENT_DATA 中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19761995/

相关文章:

node.js - 是否可以将 aws codepipeline 转换为 bitbucket 管道?

amazon-web-services - 将值从父堆栈传递到 Cloudformation 的嵌套堆栈

java - Amazon Cloudwatch Logs - PutLogEvents 请求 - 给定的 sequenceToken 无效

amazon-web-services - AWS ELB 自动扩展 CPU 利用率 > 90% - 不断创建/终止实例

amazon-web-services - Amazon Elastic Load Balancing - 自动缩放?

Python 3 博托 3,AWS S3 : Get object URL

amazon-web-services - Kubedb运算符问题

php - 从 EC2 实例登录到 CloudWatch

amazon-web-services - AWS Cloudwatch 设置 WebHook

amazon-web-services - AWS Cloudformation 和自动扩展 : The requested configuration is currently not supported. 启动 EC2 实例失败