I've created an alarm for API Gateway and modified the lambda function handler to something else so every curl request returns 5XX error when we try to call the Lambda function.
The alarm threshold is 5XX Error >= 1 for 1 data point within 1 minute
It triggers the alarm but when I check metrics it shows a Count
of 1 even though I used curl
multiple times for multiple 5XX errors.
Why does the count show as 1 when I've triggered an error that should trigger the alarm 50 times?
I was expecting that it would show 50 counts.
CodePudding user response:
You are referring to the alarm count, which is the count of how many times the alarm has been triggered based on the specific alarm period.
You may have triggered the error 50 times, but your alarm is only triggered once per alarm period (within 1 minute).
Regardless of if there are 2 requests or 500, you can only change the alarm state to ALARM
once every 1 minute.
If you are looking for the API Gateway error count, monitor the metric separately.
The alarm count is different to the metric count.