Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add metric airflow_dag_last_status #60

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 24 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,34 @@
# Airflow Prometheus Exporter

[![Build Status](https://travis-ci.org/robinhood/airflow-prometheus-exporter.svg?branch=master)](https://travis-ci.org/robinhood/airflow-prometheus-exporter)
The Airflow Prometheus Exporter exposes various metrics about the Scheduler, DAGs and Tasks which helps improve the
observability of an Airflow cluster.

The Airflow Prometheus Exporter exposes various metrics about the Scheduler, DAGs and Tasks which helps improve the observability of an Airflow cluster.

The exporter is based on this [prometheus exporter for Airflow](https://github.com/epoch8/airflow-exporter).
The exporter is based on this [prometheus exporter for Airflow](https://github.com/epoch8/airflow-exporter) and this [one](https://github.com/robinhood/airflow-prometheus-exporter).

## Requirements

The plugin has been tested with:

- Airflow >= 1.10.4
- Airflow >= 1.10.3
- Python 3.6+

The scheduler metrics assume that there is a DAG named `canary_dag`. In our setup, the `canary_dag` is a DAG which has a tasks which perform very simple actions such as establishing database connections. This DAG is used to test the uptime of the Airflow scheduler itself.
The scheduler metrics assume that there is a DAG named `canary_dag`. In our setup, the `canary_dag` is a DAG which has a
tasks which perform very simple actions such as establishing database connections. This DAG is used to test the uptime
of the Airflow scheduler itself.

## Installation

The exporter can be installed as an Airflow Plugin using:

```pip install airflow-prometheus-exporter```
```bash
pip install airflow-prometheus-exporter
```

This should ideally be installed in your Airflow virtualenv.

## Metrics

Metrics will be available at
Metrics will be available at:

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

Expand All @@ -39,7 +42,11 @@ All the possible states are listed [here](https://github.com/apache/airflow/blob

#### `airflow_task_duration`

Duration of successful tasks in seconds.
Duration of running tasks in seconds.

#### `airflow_last_task_success_time`

Last time in seconds since last task success.

#### `airflow_task_fail_count`

Expand All @@ -54,15 +61,21 @@ Number of DAGs with a specific status.
All the possible states are listed [here](https://github.com/apache/airflow/blob/master/airflow/utils/state.py#L59)

#### `airflow_dag_run_duration`
Duration of successful DagRun in seconds.

Duration of running DagRun in seconds.

#### `airflow_last_dag_success_time`

Last time in seconds since last DAG success.

### Scheduler Metrics

#### `airflow_dag_scheduler_delay`

Scheduling delay for a DAG Run in seconds. This metric assumes there is a `canary_dag`.

The scheduling delay is measured as the delay between when a DAG is marked as `SCHEDULED` and when it actually starts `RUNNING`.
The scheduling delay is measured as the delay between when a DAG is marked as `SCHEDULED` and when it actually starts
`RUNNING`.

#### `airflow_task_scheduler_delay`

Expand Down
Loading