I have an interesting scenario with AWS CloudWatch Logs. I currently use log4net and pump all of the logs into CloudWatch Logs using CloudWatch Logs agent. I have a metric in CloudWatch which basically scans for [ERROR] entries and an Alarm passes them on to another service for dev notifications as they occur (Threshold >= 1, period - 1 min). All of this is working great.
Now I want to handle certain errors differently. For instance, based on the exception type i want to only trigger Alarm when X number of occurrences happened during N minute period. So in this case I'd create a metric for this condition and then assign it the Alarm. The problem is the general error metric, explained in the first part of this question, is still tracking each individual error occurrence. So now i'm getting multiple notifications. One for each error and one after X number of occurrences.
I can disable general error metric, but than I lose the ability to track unhandled exceptions. I'd have to have a metric for each and every possible exception. Am i missing something? What's the best way to handle this?