Send customised notification of Glue job using SNS

0

I need to send notification having ** job execution time**, number of records processed and the rest of the things using SNS. Below is the template I am using, but I need these two inputs too in my notification: { "detail-type": ["Glue Job State Change"], "source": ["aws.glue"], "detail": { "jobName": ["job_name1","job_name2"], "severity": ["ERROR"], "state": ["FAILED", "ERROR", "TIMEOUT", "STOPPED"] } } Can you please help me.

1개 답변
0

Hi ,

the 2 additional inputs (job execution time, number of records processed) you require are not generated automatically by Glue.

The job execution time you can retrieve it using the Glue APIs get_job_run passing the latest run_id.

The number of record preprocessed you would need to calculate it in the job and then export it in and external file or db table you can query to retrieve it and add it to the SNS message before you send it.

hope this helps.

AWS
전문가
답변함 2년 전
  • Hi, thanks for the response. How do I use the API and the querying file/table part, should I use a Lambda function for this?

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인