Git Product home page Git Product logo

airflow_slack_operator's Introduction

Airflow Slack Operator

This provides a module and example usage for an Airflow Slack alert operator. It uses the code shown in Kaxil Naik's Integrating Slack Alerts in Airflow Medium article, with some minor additions and example code.

This Medium article, Slack Alerts in Airflow describes this code with some visuals.

Usage

This assumes you already have Airflow running.

Install Slack Webhooks

Follow the article Integrating Slack Alerts in Airflow and install the necessary Webhooks and API key into your Airflow connections. Perform this on your deployed Airflow configuration.

(Optional) Initial Local Tests

These are optional, but helps ensure a healthy DAG before launching it. Run these on a local airflow instance before saving them to a final deployed one.

  1. Install airflow locally: pip install -r requirements.txt. This gives you access to airflow commands in later steps.
  2. Copy the contents of dags into your local airflow dags directory
  3. Confirm DAG compiles with: python dags/dag_coin_flip.py
  4. Confirm it can be bagged: airflow initdb.
  5. Confirm the task can be run: airflow test hourly_coin_flip coin_flip 2019-01-01
    • Run this a couple times. Sometimes it should raise a ValueError (forced fail), i.e. "flipping tails". Sometimes it will raise airflow.exceptions.AirflowException: The conn_id slack isn't defined, because this is a local Airflow without Slack hooked in.

Installation

Similar to other Airflow DAGs, just copy the contents of dags into your deployed Airflow dags directory.

airflow_slack_operator's People

Contributors

tszumowski avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.