当 Glue 作业失败时,glue.driver.aggregate.numFailedTasks CloudWatch 指标不会记录失败

发布于 2025-01-13 05:29:16 字数 580 浏览 0 评论 0 原文

我有一个 Glue PySpark 作业,大约 2 分钟后失败,并出现 AnalysisException 和运行状态 Failed。我想检测它的 CloudWatch 警报。在 CloudWatch 指标中,我预计它在此期间记录的计数为 1,但实际记录为 0。我正在使用以下指标配置:

   MetricName: glue.driver.aggregate.numFailedTasks
   JobRunId: ALL
   JobName: <MyGlueJobName>
   Statistic: Sum
   Period: 1 min
   Type: Count

看来其他指标正在运行,例如glue.driver.jvm.heap。使用了但没有使用numFailedTasks 。我做错了什么吗?

I have a Glue PySpark job which has failed after approx 2 mins with an AnalysisException and a Run Status of Failed. I want to detect it for a CloudWatch alarm. In CloudWatch metrics I'm expecting it to record a count of 1 over the period, but it's recording 0. I'm using the following metric config:

   MetricName: glue.driver.aggregate.numFailedTasks
   JobRunId: ALL
   JobName: <MyGlueJobName>
   Statistic: Sum
   Period: 1 min
   Type: Count

It appears other metrics are working e.g. glue.driver.jvm.heap.used but not numFailedTasks. Am I doing something wrong?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

最终幸福 2025-01-20 05:29:16

我们的胶水作业也有类似的问题/要求。我们有很多工作,需要监控成功和失败。我们还发现内置指标并不真正可靠。但即使它们是,它们也不能真正回答工作是否成功的问题。我们找到了一种好方法,即以通用方式为所有作业生成自定义指标。这也适用于之后的现有作业,而无需更改代码。我写了一篇关于它的文章: https://medium.com/@ettefette/metrics-for-aws-glue-jobs-as-you-know-them-from-lambda-functions-e5e1873c615c

We had a similar problem/requirement with our glue jobs. We have many jobs and need to monitor success and failure. We've also experienced that the built-in metrics aren't really reliable. But even if they were, they don't really answer the question of whether or not a job was successful. We found a good way for us by generating custom metrics in a generic way for all jobs. This also works for existing jobs afterwards without having to change the code. I wrote an article about it: https://medium.com/@ettefette/metrics-for-aws-glue-jobs-as-you-know-them-from-lambda-functions-e5e1873c615c

水中月 2025-01-20 05:29:16

我设法解决这个问题的唯一方法是创建一个自定义指标。我使用 put_metric_data 创建了一个指标。当 pyspark 脚本中引发异常时,我会调用它。

The only way that I managed to get around this problem was to create a custom metric. I created a metric using put_metric_data. I call it when an exception is raised in the pyspark script.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文