I have an api say apifortest
which has at 10 methods under different paths. Those methods are GET
, PUT
and POST
. What I want to do is create a CloudWatch monitor for these.
I was looking at documentation here
http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/api-gateway-metrics-dimensions.html
This is what I had earlier
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]
But this alarm is being set At API Level. I want to setup at method level. The documetion does states that we can do so, but it doesn't have any example.
Any help would be appreciated.
The documentation lists the dimensions you need to use:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With