gpt4 book ai didi

amazon-web-services - 如何使用 CloudFormation 为特定 Lambda 设置 Lambda 警报?

转载 作者:行者123 更新时间:2023-12-04 16:57:40 25 4
gpt4 key购买 nike

这是来自AWS document的CloudFormation Alarm的结构.

Type: "AWS::CloudWatch::Alarm"
Properties:
ActionsEnabled: Boolean
AlarmActions:
- String
AlarmDescription: String
AlarmName: String
ComparisonOperator: String
Dimensions:
- Dimension
EvaluateLowSampleCountPercentile: String
EvaluationPeriods: Integer
ExtendedStatistic: String
InsufficientDataActions:
- String
MetricName: String
Namespace: String
OKActions:
- String
Period: Integer
Statistic: String
Threshold: Double
TreatMissingData: String
Unit: String

但是,它似乎为总 lambda 函数指标的数字设置了警报,而不仅仅是特定函数,而且我找不到任何关于为特定函数设置警报的提及。

如何为特定功能设置闹钟?

最佳答案

要针对特定​​ lambda 函数的指标发出警报,您必须设置 FunctionName 维度。

例如这样:

  MyNewAlarm:
Type: AWS::CloudWatch::Alarm
Properties:
AlarmName: "AlarmNameGoesHere"
AlarmDescription: "Alarm if lambda errors out too many times"
Namespace: "AWS/Lambda"
MetricName: "Errors"
Dimensions:
- Name: "FunctionName"
Value: "NameOfYourLambdaFunction"
Statistic: "Sum"
ComparisonOperator: "GreaterThanThreshold"
Threshold: 0
EvaluationPeriods: 5
Period: 60
TreatMissingData: "breaching"

关于amazon-web-services - 如何使用 CloudFormation 为特定 Lambda 设置 Lambda 警报?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51202166/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com