Technical Articles
How to set immediate alert when Pipeline Job gets Failed
Hi everyone,
Background to this Article: ?
I recently got a question from customer, How to get a real time alerts when there is event of failure job noticed and quickly alert their Internal teams who are experienced to resolve failed pipeline job or work with SAP Technical Support team.? Do you have any solution to address my team ?
In today’s scenario, customer comes to identify the pipeline job failure after someone reports by logging into UI Pipeline workspace or the next day, so the time and SLA is down..
Most of you will have to think in quick time in troubleshooting failed job when already time is crossed.. Situation will be like this
My Solution? to the above question is below & successfully implemented for customer request
The purpose of this article is to explain how to get Alerts when there is event of pipeline job gets failed in real time and saves time to resolve.
( Note : This is a custom solution for customers looking to implement real time alerts/notifications)
Prerequisites
- The Visual Studio Code installed on your machine
- The latest Python version (Py) installed on your machine
- SAP Commission user having RestAPI role to authenticate Pipeline Jobs
- Scheduling Job for Python script to run every second ( Unix – Crontab – Preferred)
- A basic understanding of writing Python language
- Slack Channel for sending Alerts ?
Python Script – Checks Status in Failed for jobs triggered current date.
Pipeline Status shows latest pipeline job got failed – Needs Urgent Attention
Script will get the latest job with results in JSON
How to send Real-time alerts to Admin ?
Install Slack, create your own Channel and create a web-hook to send notifications to your channel.
Python script will send a information to your channel through web-hook link in real time from auto scheduler . you can find lot many source in the internet to know more details.
? Reference screenshot for above use case.
Lesson learnt from this : Customers expect personalized digital experiences to solve issues in quick time.
Thanks, for reading it till the end. 🙏
Hope you find that helpful! Let me know your thoughts on this in the comments section.
Don’t forget to share this article with your friends or colleagues.
Feel free to connect with me on any of the platforms below! 🚀
Nice Article yoga.
Thanks Mike!!
Nicely Explained!! Thank you Yoga.
Thanks Praveen!!
Nice article, Yoga!! Thank you for sharing 🙂
Thanks Vijaya Rayapudi !!!
Great Article Yoga!!, very useful for some customers needs
Thanks Javier Miranda
Really good article. The only callout that I can see is that you'll need a dedicated host to run the script on, ensuring it's always on (particularly if you're sending notifications to a team, and not just yourself).
Tas Cullen
Thank you for reading the blog ! Keep circulating to your friends as well 🙂
yes , you will have to deploy it VM box and have cronJob enabled or enable BTP Job Scheduling Services, so its always checks in every min and if it finds your filter.. it will push a notification to end user via 3rd Party communication channel.