【问题标题】:How can I monitor glue crawler execution stats?如何监控胶水爬虫执行统计信息?
【发布时间】:2019-07-26 04:34:58
【问题描述】:

我正在使用AWS Glue 进行数据 ETL。我找不到在 AWS 上监控 glue crawler 执行统计数据的方法。我知道如何监控像这个文档这样的胶水作业:https://docs.aws.amazon.com/glue/latest/dg/monitoring-awsglue-with-cloudwatch-metrics.html。但是我想知道是否有类似的方法来检查glue crawler的执行情况?

我可以在Cloudwatch 中查看爬虫的日志,但它的可读性不是很高。我很难弄清楚在指定时间段内发生了多少次调用。

【问题讨论】:

    标签: amazon-web-services aws-glue aws-glue-data-catalog


    【解决方案1】:

    我向 AWS 支持中心提出了同样的问题。答案如下:

    据我了解,Glue 爬虫不会发布 CloudWatch 指标以用于执行和您希望监控的统计信息,但是 Glue 爬虫能够将日志发布到 CloudWatch 日志组和日志流。根据这些日志事件消息,您可以创建一个指标过滤器 [1] 以匹配特定的过滤器模式,并生成您自己的指标来监控和警报。例如,如果指标过滤器检测到过滤器模式“Crawler 已完成运行并处于 READY 状态”,它将向您的自定义命名空间指标发布一个值。以下是创建指标过滤器的一些步骤:

    1) Open the CloudWatch Log Groups console
    2) Select the Glue crawler log group
    3) Select Metric filters, choose Create metric filter
    4) In Filter pattern, enter a pattern that you want to match in the log streams, ie: "Crawler has finished running and is in state READY", then choose Next
        4a) You can test your filter pattern against a log stream or by manually specifying log event messages
    5) Enter a filter name, enter a customer metric namespace, metric name, metric value. The metric value while be published on the metric, ie: 1, then choose Next
    6) Review the metric filter configuration and choose Create metric filter
    

    CloudWatch Events 能够根据 Glue 爬虫状态更改调用目标,例如,如果爬虫状态更改为失败,这可能会调用 SNS 主题目标并向您发送电子邮件。以下是创建 CloudWatch 事件的一些步骤:

    1) Open the CloudWatch Rules console
    2) Choose Create rule
    3) In Service Name, select Glue, in Event Type select Glue Crawler State Change
    4) Choose Specific state(s) and choose Failed
    5) Add a Target, for example SNS Topic, choose Configure details
    6) Enter a Rule name and choose Create rule
    

    尽情享受您的一天。

    【讨论】:

    • 创建指标过滤器,禁用选项 ID
    猜你喜欢
    • 2019-10-31
    • 1970-01-01
    • 2023-01-23
    • 2020-07-20
    • 2010-09-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多