I will want to get notified whenever there is a 500 error in my service. So, I created a metric filter in CloudWatch under a specific log group. Pattern is correct as per my application log logic. Metric is chosen as 1. Alarm is configured too with parameter values as below -
- Period 1 min
- Stat standard sum
- whenever my metric filter is >=1 for 1 consecutive periods
- whenever state is alarm is chosen under notification
- remaining are straight forward
I manually called APIs of my application and generated 500 many time over many consecutive minutes. I have also used apache bench to generate such errors in bulk for consecutive minutes.
But always I do see that my alarm is in insufficient data. As a results, email notification which is configured as action to alarm does not get called.
How to get rid of the problem? Any suggestion will be helpful.