我有一个api说apifortest
,它在不同路径下有10种方法。这些方法是GET
,PUT
和POST
。我想要做的是为这些创建一个CloudWatch监视器。
我在这里看文件
http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/api-gateway-metrics-dimensions.html
这就是我之前的内容
TestApiCloudWatch:
Type: "AWS::CloudWatch::Alarm"
Properties:
ActionsEnabled: "True"
AlarmName: "ApiGateway-TestAPI-5XXError-SEV2"
ComparisonOperator: !FindInMap [APIGatewayCloudWatchMappings, 5XXError-SEV2, ComparisonOperator]
Dimensions:
-
Name: "ApiName"
Value: "APIForTest"
-
Name: "Stage"
Value: "Prod"
EvaluationPeriods: !FindInMap [APIGatewayCloudWatchMappings, 5XXError-SEV2, EvaluationPeriods]
MetricName: !FindInMap [APIGatewayCloudWatchMappings, 5XXError-SEV2, MetricName]
Namespace: "AWS/ApiGateway"
Period: !FindInMap [APIGatewayCloudWatchMappings, 5XXError-SEV2, Period]
Statistic: !FindInMap [APIGatewayCloudWatchMappings, 5XXError-SEV2, Statistic]
Threshold: !FindInMap [APIGatewayCloudWatchMappings, 5XXError-SEV2, Threshold]
但是此警报设置为在API级别。我想在方法级别进行设置。该文件确实表明我们可以这样做,但它没有任何例子。
任何帮助都将不胜感激。
答案 0 :(得分:3)
文档列出了您需要使用的维度: