如何使用Azure Monitor或ADF本身触发Azure Data Factory V2中长时间运行的过程的警报通知? [英] How to trigger an alert notification of a long-running process in Azure Data Factory V2 using either Azure Monitor or ADF itself?

查看:101
本文介绍了如何使用Azure Monitor或ADF本身触发Azure Data Factory V2中长时间运行的过程的警报通知?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在试图找到一种最佳方法,当ADF任务(即CopyActivity或存储过程任务)运行超过N个小时时,触发警报.我想使用Azure监视器,因为它是其中之一Azure中推荐的通知服务,但是我找不到运行"条件,因此我不得不使用可用条件(成功"和失败")并每N小时检查一次,但是,这仍然不完美不知道流程何时开始,我们可能一天要多次手动运行该流程,您有什么建议这样做吗?例如基于事件的通知,它会侦听某个时间变量,并且一旦它超过阈值,就会立即触发电子邮件通知?

I've been trying to find the best way to trigger an alert when an ADF task (i.e. CopyActivity or Stored Procedure Task) has been running for more than N hours, I wanted to use the Azure Monitor as it is one of the recommended notification services in Azure, however I have not been able to find a "Running" criteria, hence I had to play with the available criteria (Succeeded and Failed) and check this every N hours, however this is still not perfect as I don't know when the process started and we may run the process manually multiple times a day, is there any way you would recommend doing this? like a event-based notification that listens to some time variable and as soon as it is greater than the threshold triggers an email notification?

推荐答案

您有什么建议这样做的方法吗?像基于事件的 通知,它会立即监听某个时间变量 大于阈值会触发电子邮件通知?

is there any way you would recommend doing this? like a event-based notification that listens to some time variable and as soon as it is greater than the threshold triggers an email notification?

根据您的要求,建议您使用 Azure数据工厂SDK 来监视您的管道和活动.

Based on your requirements, I suggest you using Azure Data Factory SDKs to monitor your pipelines and activities.

您可以创建时间触发Azure函数,每N小时触发一次.在该触发函数中:

You could create a time trigger Azure Function which is triggered every N hours. In that trigger function :

  1. 您可以列出所有运行活动.

然后将它们循环以监视 DurationInMs 属性. datafactory.models.activityrun?view = azure-dotnet"rel =" nofollow noreferrer> ActivityRun类检查是否有任何活动已经运行了N个小时以上并且仍在进行中

Then loop them to monitor the DurationInMs Property in ActivityRun Class to check if any activity has been running for more than N hours and it's still In-Progress status.

最后,发送电子邮件或取消活动或执行任何您想做的事情.

Finally, send the email or kill the activity or do whatever you want.

这篇关于如何使用Azure Monitor或ADF本身触发Azure Data Factory V2中长时间运行的过程的警报通知?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆