当 Glue 作业失败时,glue.driver.aggregate.numFailedTasks CloudWatch 指标不会记录失败
我有一个 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 。我做错了什么吗?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我们的胶水作业也有类似的问题/要求。我们有很多工作,需要监控成功和失败。我们还发现内置指标并不真正可靠。但即使它们是,它们也不能真正回答工作是否成功的问题。我们找到了一种好方法,即以通用方式为所有作业生成自定义指标。这也适用于之后的现有作业,而无需更改代码。我写了一篇关于它的文章: 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
我设法解决这个问题的唯一方法是创建一个自定义指标。我使用 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.