Glue notification property: "Delay notification threshold"

0

Glue appears to have this Delay notification threshold option that sends an event. Where does this event populate? Where can I see if this even is firing or capture it so that I can send an SNS triggered email? Has anyone ever used this functionality? I have not been able to find much on the internet about it and the one Stack Overflow post about it was asking the exact same question 2 years ago, but with no response.

`Apart from this you can use Glue job inbuilt "Delay notification threshold" option in which If the job runs longer than the specified time Glue will send a delay notification via CloudWatch. [1][2]

--Reference: [1] https://docs.aws.amazon.com/glue/latest/dg/console-jobs.html [2] https://docs.amazonaws.cn/en_us/glue/latest/dg/automating-awsglue-with-cloudwatch-events.html`

1 Answer
1

Hello,

At the high level, in Amazon EventBridge, which was formerly called Amazon CloudWatch Events, you create a rule based on your Glue job name, job state, select targets such as send a message to a SNS Topic. When a Glue job run execution time reaches the threshold specified by "Delay notification threshold (minutes)" parameter in the job detail, AWS Glue sends a notification ("Glue Job Run Status") to CloudWatch Events which will match against the rule created earlier.

I have tried and it works on my end. Below is my steps.

  1. Create a Glue job and specific "Delay notification threshold (minutes)" parameter in the job detail. You can use Python sleep function to control the execution time as following:
import time

#In seconds
time.sleep(100)
print("Printed after 100 seconds.")
  1. Create a topic and subscribe to it using my email in Amazon SNS Console.
  2. Create a rule by navigating to Amazon EventBridge Console > Buses > Rules > Create Rule > then create a rule with below properties: Rule type = Rule with an event pattern Creation method = Custom pattern (JSON editor) Pattern example 1: below pattern will match against any job state
{
  "source": ["aws.glue"],
  "detail-type": ["Glue Job Run Status"],
  "detail": {
    "jobName": ["<Glue job name>"]
  }
}

Pattern example 2: below pattern will match against a specific job state

{
  "source": ["aws.glue"],
  "detail-type": ["Glue Job Run Status"],
  "detail": {
    "jobName": ["<Glue job name>"],
    "state": ["RUNNING"]
  }
}

***Note: - Replace the Glue job name by your job name accordingly - In the example 2, there are valid values for state: STARTING, RUNNING, STOPPING

  • Target = SNS Topic > select the topic created in step 2
  1. Run your Glue job and you should be able to receive the email notification if the job run execution time reaches the threshold specified by "Delay notification threshold (minutes)" parameter.

I hope this helps.

I suggest to create a case with AWS Support if you need further assistance.

Thank you.

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions