英文:
AppRunner CloudWatch Alarm not showing metrics
问题
我正在尝试为AppRunner创建一个警报。我的AppRunner服务正常运行。
以下是警报的代码。它不断显示"Insufficient data"(数据不足)。奇怪的是,手动创建警报也会导致相同的无数据消息。我尝试了内存指标,但结果一样。有什么想法?
resource "aws_cloudwatch_metric_alarm" "apprunner_cpu" {
alarm_name = "<redacted>"
comparison_operator = "GreaterThanOrEqualToThreshold"
evaluation_periods = 2
metric_name = "CPUUtilization"
namespace = "AWS/AppRunner"
period = 60
statistic = "Average"
threshold = 80
alarm_description = "AppRunner CPU utilization"
insufficient_data_actions = []
dimensions = {
ServiceName = aws_apprunner_service.main.service_name
ServiceID = aws_apprunner_service.main.service_id
}
}
英文:
I'm trying to create an alarm for AppRunner. My AppRunner service is running fine.
Here is the code for the alarm. It keeps showing "Insufficient data". Weirdly enough, creating an alarm manually also results in the same no data message. I've tried memory metrics but same thing. Any ideas?
resource "aws_cloudwatch_metric_alarm" "apprunner_cpu" {
alarm_name = "<redacted>"
comparison_operator = "GreaterThanOrEqualToThreshold"
evaluation_periods = 2
metric_name = "CPUUtilization"
namespace = "AWS/AppRunner"
period = 60
statistic = "Average"
threshold = 80
alarm_description = "AppRunner CPU utilization"
insufficient_data_actions = []
dimensions = {
ServiceName = aws_apprunner_service.main.service_name
ServiceID = aws_apprunner_service.main.service_id
}
}
答案1
得分: 0
好的,以下是翻译好的部分:
所以,我发现在定义的评估期间,经过一些连续的请求后,数据被加载到警报中。我可以假设这是由于闲置容器功能。
当您的应用程序处于空闲状态时,您按照为预留容器实例的内存每GB支付费用,这些容器实例会保持您的应用程序处于热启动状态,并消除冷启动。当请求进来时,您的应用程序以毫秒为单位响应,并按照您的活动容器实例消耗的vCPU和内存支付费用,因为您的应用程序正在处理请求。
在此问题上找到了更多信息。
英文:
Ok, so I discovered that after hitting some consistent requests during the defined evaluation period, data was loaded into the alarm. I can assume that this is due to the idle container features.
From the App Runner pricing page:
> When your application is idle, you pay per GB of memory for provisioned container instances which keep your application warm and eliminate cold starts. When requests come in, your application responds in milliseconds, and you pay for the vCPU and memory consumed by your active container instances as your application is processing requests.
Found some more info on this issue.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论