AppRunner CloudWatch警报未显示指标

huangapple go评论63阅读模式
英文:

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
  }
}

AppRunner CloudWatch警报未显示指标

AppRunner CloudWatch警报未显示指标

英文:

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 &quot;aws_cloudwatch_metric_alarm&quot; &quot;apprunner_cpu&quot; {
  alarm_name                = &quot;&lt;redacted&gt;&quot;
  comparison_operator       = &quot;GreaterThanOrEqualToThreshold&quot;
  evaluation_periods        = 2
  metric_name               = &quot;CPUUtilization&quot;
  namespace                 = &quot;AWS/AppRunner&quot;
  period                    = 60
  statistic                 = &quot;Average&quot;
  threshold                 = 80
  alarm_description         = &quot;AppRunner CPU utilization&quot;
  insufficient_data_actions = []

  dimensions = {
    ServiceName = aws_apprunner_service.main.service_name
    ServiceID   = aws_apprunner_service.main.service_id
  }
}

AppRunner CloudWatch警报未显示指标

AppRunner CloudWatch警报未显示指标

答案1

得分: 0

好的,以下是翻译好的部分:

所以,我发现在定义的评估期间,经过一些连续的请求后,数据被加载到警报中。我可以假设这是由于闲置容器功能。

App Runner价格页面

当您的应用程序处于空闲状态时,您按照为预留容器实例的内存每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.

AppRunner CloudWatch警报未显示指标

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.

huangapple
  • 本文由 发表于 2023年6月1日 09:20:40
  • 转载请务必保留本文链接:https://go.coder-hub.com/76378130.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定