I have a system where I need to process several messages (say 500) every 10 minutes or so using lambda. As an example, let’s assume that the following things can happen when processing messages:
- Message has no issues (success)
- Message cannot be parsed
- Message can be parsed but does not meet expectation
- Message can be parsed but is invalid
- …
- Some unidentified errors during processing
I want a separate metric and alarm for #2 through the last one. By default, cloudwatch metric allows me to handle the last one. To handle others, I can create a separate SNS topic for each thing and count its invocation. Or, it seems like I can use a custom metric function. What are the pros and cons of each approach? Is their another better way?