cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
cancel
Showing results for 
Search instead for 
Did you mean: 

How can I extract/get the time, along with the status (Failed or Succeeded) into a table for every time my Databricks job finishes running?

yatharth29
New Contributor II

I want to get a mail notification at the end of each day for when my Databricks job has finished running and for that I need to extract the time of it's completion and it's status. How can I achieve that?

5 REPLIES 5

Kaniz
Community Manager
Community Manager

Hi @ yatharth29! My name is Kaniz, and I'm the technical moderator here. Great to meet you, and thanks for your question! Let's see if your peers in the community have an answer to your question first. Or else I will get back to you soon. Thanks.

yatharth29
New Contributor II

Hi @Kaniz Fatma​ . Sure, Thanks!

Kaniz
Community Manager
Community Manager

Hi @yatharth29,

Email alerts are sent in case of job failure, success, or timeout. You can set alerts up for job start, job success, and job failure (including skipped jobs), providing multiple comma-separated email addresses for each alert type. You can also opt-out of alerts for skipped job runs.

You can definitely schedule your job by entering the specific details here:-Screenshot 2021-11-11 at 7.28.05 PM 

You can set email alerts accordingly too:-

Screenshot 2021-11-11 at 7.25.03 PM 

You'll find the detailed instructions here in this link as well:-

https://docs.databricks.com/jobs.html

yatharth29
New Contributor II

Hi @Kaniz Fatma​ ,

Thanks but this not exactly what I wanted. I just want to get the time at which the job ended along with its status in a delta table on Databricks itself and this table will be used to create and send a custom mail which will contain other additional information. So the goal is to get the time of job completion first and then the mail will be created after getting the job related information. Is there any way to achieve that?

Thanks in advance.

Prabakar
Esteemed Contributor III
Esteemed Contributor III

Hi @Yatharth Kaushik​  you can use the JobsRunList API to get all the information of the job run. You can write a code to extract the information that you need for the table.

The are multiple API's in the same doc that you can use to get information about the jobs and runs.

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.