0

I have a cloudWatch alert setup on all lambdas sending data to a an SNS topic

Using the metric as sum(errors) across all functions

I get the notification as expected, but there is no information in there to identify which amongst my lambdas triggered the alarm or in other words which one failed

If I setup the alarm individually on each lambda, then I get the information on which one failed under Dimensions. But I have a lot of them and plan to add more and this process will become painful

How can I leverage cloudWatch to alert me on all lambda failures and also provide info on which lambda failed and the error message ?

Should this be implemented in a different way ?

Ajay
  • 177
  • 9

1 Answers1

0

The AWS Cloud Operations & Migrations Blog has a post published on this topic.

Instead of using CloudWatch Alarms as you are doing now, you can use a CloudWatch Logs subscription. Whenever a log entry matches a specific pattern that you specify, it will trigger a new Lambda function that can notify you however you choose. In the blog post, the Lambda uses SNS to send an email notification.

You can control what information gets included in the body of the notification by adjusting what the Lambda function sends to SNS. The log group name, log stream, and the error message itself can be included.

Jae
  • 1