简体   繁体   English

当多个数据流作业在 GCP 中并行运行时触发警报

[英]Triggering an alert when multiple dataflow jobs run in parallel in GCP

I am using google cloud dataflow to execute some resource intensive dataflow jobs.我正在使用谷歌云数据流来执行一些资源密集型数据流作业。 And at a given time, my system must execute no more than 2 jobs in parallel.在给定时间,我的系统必须并行执行不超过 2 个作业。

Since each job is quite resource intensive, I am looking for a way to trigger an alert when more than 2 dataflow jobs are running.由于每个作业都非常耗费资源,因此我正在寻找一种在运行 2 个以上数据流作业时触发警报的方法。

I tried implementing a custom_count which increments after the start of each job.我尝试实现一个 custom_count,它在每个作业开始后递增。 But custom_couter only display after the job has executed.但 custom_couter 仅在作业执行后显示。 And it might be too late to trigger an alert by then.到那时触发警报可能为时已晚。

You could modify the quota dataflow.googleapis.com/job_count of the project to be limited to 1, and no two jobs could run parallel in that project.您可以修改项目的配额dataflow.googleapis.com/job_count限制为1,并且该项目中不能同时运行两个作业。 The quota is at the project level, it would not affect other projects.配额是项目级别的,不会影响其他项目。

Another option is to use an GCP monitoring system that is observing the running Dataflow jobs.另一种选择是使用 GCP 监控系统来观察正在运行的数据流作业。 You can eg use Elastic Cloud (available via Marketplace) to load all relevant Metrics and Logs.例如,您可以使用 Elastic Cloud(可通过 Marketplace 获取)加载所有相关指标和日志。 Elastic can visualize and alert on every state you are interested in. I found this terraform project very helpful in order to get started with that approach. Elastic 可以对您感兴趣的每个 state 进行可视化和提醒。我发现这个terraform 项目对于开始使用该方法非常有帮助。

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

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