Catch the data pipeline that didn’t finish.
When a nightly ETL job or report fails, people find out from a wrong number on a dashboard. Have the job ping Runbell at start and finish, and know before the morning meeting.
Up
nightly-etl
- Schedule
0 2 * * *every night at 02:00- Grace period
- 2 hours
- Alerts
- Email to the data team
What goes wrong without anyone noticing
- A source is down
- An API or database the job reads from doesn’t answer, and the load is skipped.
- The job runs too long
- The data grows, a one-hour run takes three, and the report misses its deadline.
- It fails halfway
- Half the tables are updated, and nothing says the rest aren’t.
Set it up
-
Create a check
Use the schedule
0 2 * * *and a grace period of 2 hours, in the time zone the job runs in. -
Add the ping
Ping
/startbefore the work, the plain address when it succeeds, and/failwhen it raises an error. -
Choose who hears about it
Connect email, Slack, Telegram, SMS or any of the other channels to the project.
etl.py
import urllib.request
URL = "https://runbell.app/ping/your-check-id"
def ping(path=""):
urllib.request.urlopen(URL + path, timeout=10)
ping("/start")
try:
run_etl()
ping()
except Exception:
ping("/fail")
raise
Tips
- The
/startping measures run time, so you see a job that is slowly getting slower. - Give each step its own check when the steps run on different machines.
- Airflow, Dagster and Prefect can send the ping from a final task or a success callback.
Questions
Do you see our data?
No. The ping is an empty request. You decide whether to send any log text with it.
Can the alert go to the business team, not only engineers?
Yes. Add their email or a Microsoft Teams channel to the project; alerts are written in plain words.
Other jobs to watch
- pg_dump, mysqldump Database backups Know the night a backup fails, not the day you need it.
- crontab Linux cron jobs An alert when a crontab job is late, missing or fails.
- PowerShell Windows Task Scheduler Know when a scheduled task didn’t run or failed.
- batch/v1 Kubernetes CronJobs Catch the CronJob that never started a pod.
- certbot, ACME Certificate renewal Find out before an expired certificate does.