Skip to content

Latest commit

 

History

History
84 lines (52 loc) · 1.75 KB

README.md

File metadata and controls

84 lines (52 loc) · 1.75 KB

Airflow prometheus exporter

travis build status

Exposes dag and task based metrics from Airflow to a Prometheus compatible endpoint.

Screenshots

Dependencies

  • Airflow: airflow1.8 - airflow1.10
  • Python: python2, python3
  • DataBase: postgresql, mysql

Install

Install project requirements:

pip3 install prometheus_client

Switch to the root of your Airflow project.

git clone https://github.com/epoch8/airflow-exporter plugins/prometheus_exporter

That's it. You're done.

Docker Install

If you use airflow in docker you can simply modify your Dockerfile like this:

RUN cd ${AIRFLOW_HOME}/plugins && \
    wget https://github.com/epoch8/airflow-exporter/archive/${AIRFLOW_EXPORTER_VERSION}.tar.gz -O airflow-exporter-${AIRFLOW_EXPORTER_VERSION}.tar.gz && \
    tar zxf airflow-exporter-${AIRFLOW_EXPORTER_VERSION}.tar.gz

Metrics

Metrics will be available at

http://<your_airflow_host_and_port>/admin/metrics/

airflow_task_status

Labels:

  • dag_id
  • task_id
  • owner
  • status

Value: number of tasks in specific status.

airflow_dag_status

Labels:

  • dag_id
  • owner
  • status

Value: number of dags in specific status.

airflow_dag_run_duration

Labels:

  • dag_id: unique identifier for a given DAG
  • run_id: unique identifier created each time a DAG is run

Value: duration in seconds that a DAG Run has been running for. This metric is not available for DAGs that have already completed.

License

Distributed under the BSD license. See LICENSE for more information.