MediaMath / lambda-cron

LambdaCron - serverless cron tool
Apache License 2.0
25 stars 4 forks source link

Feature: Create a metric to track exceptions from the TaskRunner #5

Closed rmalecky closed 7 years ago

rmalecky commented 7 years ago

Currently the lambda function is catching exceptions in the TaskRunner. Do we want to create a way of alerting when this happens? One option is a cloudwatch metric filter on the log group.

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-metricfilter.html

http://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/MonitoringLogData.html

javibravo commented 7 years ago

If I am not wrong those errors will trigger the alarm we have right now: https://github.com/MediaMath/lambda-cron/blob/master/lambda_cron/template.cfn.yml#L119

But not sure. Would need to look into it.

rmalecky commented 7 years ago

Does printing to StdError alone trigger an alarm? I thought the function had to exit non-zero. https://github.com/MediaMath/lambda-cron/blob/master/lambda_cron/aws/main.py#L58

javibravo commented 7 years ago

You are right. Metric filter on the Log Group must be added.