Sign inSign up

lorello/airflow-slack

By lorello

•Updated about 6 years ago

Receive a Slack notification when one or more Airflow Tasks misses their SLA.

Image
0

1.5K

lorello/airflow-slack repository overview

⁠Slack notifier for Airflow Tasks SLA misses

Airflow support natively the notification of SLA misses, but only using e-mail.

Example of alert:

Example

⁠How it works

The daemon periodically check on the database if there are tasks that missed their sla: this is a native functionality of Airflow. If some task is late, the daemon send a slack message and update the airflow database flagging the miss as notified.

⁠Requirements

Airflow must to be configured to use Postgres as database, other configuration are not supported.

⁠Configuration

The script is configured using environment variables

VariableDescription
PGHOSTpostgresql hostname of airflow
PGUSER postgresql username of airflow
PGPASSWORDpostgresql password of airflow
PGDATABASEpostgresql database of airflow
SLACK_URLSlack webhook to send notifications
SLACK_CHANNELSlack channel
SLACK_TOAdd one or more @user1 @user2 to the message posted
SCHEDULEIf not defined the container exits after one execution. If defined the container stay up and run the script periodically
TRACEIf valorized enable debugging on the bash scripts (set -x)

The format for schedule variable is defined by cron package⁠: you can use the common cron syntax with 6 fields (seconds, minutes, hours, day of month, month, day of week) and also the common shortcuts like @hourly, @daily, @weekly.

Tag summary

Content type

Image

Digest

Size

9.6 MB

Last updated

about 6 years ago

docker pull lorello/airflow-slack