简体   繁体   English

如果 AWS Lambda function 在指定时间段(假设 2 小时)内未运行(或未被触发),是否可以发送警报?

[英]Is there a way to send an alert if an AWS Lambda function is not running(or not being triggered) for a specified period of time (let's say 2 hours)?

In our team's infrastructure we have a Databricks job which sends data to an SQS queue which triggers a Lambda function. The Databricks job runs one in every 30 minutes.在我们团队的基础设施中,我们有一个 Databricks 作业,它将数据发送到触发 Lambda function 的 SQS 队列。Databricks 作业每 30 分钟运行一次。 A week ago the Databricks job was failing continuously so it was not sending data, therefore the Lambda function was not triggered.一周前,Databricks 作业连续失败,因此它没有发送数据,因此没有触发 Lambda function。 Is there any way to set up an alert so that I get notified if the lambda function is not triggered for a period of 2 hours?有什么方法可以设置警报,以便在 lambda function 2 小时内未触发时通知我?

When I searched for a solution I was only able to see to get an alert if and when a Lambda fails or if a specific log type is found in its cloudwatch logs etc, but couldn't see any solution for the above scenario.当我搜索解决方案时,我只能看到在 Lambda 失败时或在其 cloudwatch 日志等中找到特定日志类型时收到警报,但看不到针对上述情况的任何解决方案。

You can create a Cloudwatch alarm for the Invocation metrics for that lambda;您可以为该 lambda 的Invocation指标创建 Cloudwatch 警报; you can configure the alarm so that if there are no invocations over a timespan of two hours, it goes into an ALARM state.您可以配置警报,以便如果在两个小时的时间跨度内没有调用,它将进入警报 state。

If you wish to be notified, you can also configure the Cloudwatch alarm to send a message to an SNS topic, which can then be configured to trigger SES so that it sends you an email (for example).如果您希望收到通知,您还可以将 Cloudwatch 警报配置为向 SNS 主题发送消息,然后可以将其配置为触发 SES,以便它向您发送 email(例如)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM