Skip to main content

Airflow Prometheus Exporter

Build Status

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.

Requirements

The plugin has been tested with:

  • Airflow >= 1.10.4
  • 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.

Installation

The exporter can be installed as an Airflow Plugin using:

pip install airflow-prometheus-exporter

This should ideally be installed in your Airflow virtualenv.

Metrics

Metrics will be available at

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

Task Specific Metrics

airflow_task_status

Number of tasks with a specific status.

All the possible states are listed here.

airflow_task_duration

Duration of successful tasks in seconds.

airflow_task_fail_count

Number of times a particular task has failed.

airflow_xcom_param

value of configurable parameter in xcom table

xcom fields is deserialized as a dictionary and if key is found for a paticular task-id, the value is reported as a guage

Add task / key combinations in config.yaml:

xcom_params:
  -
    task_id: abc
    key: count
  -
    task_id: def
    key: errors

a task_id of 'all' will match against all airflow tasks:

xcom_params:
 -
    task_id: all
    key: count

Dag Specific Metrics

airflow_dag_status

Number of DAGs with a specific status.

All the possible states are listed here

airflow_dag_run_duration

Duration of successful DagRun in seconds.

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.

airflow_task_scheduler_delay

Scheduling delay for a Task in seconds. This metric assumes there is a canary_dag.

airflow_num_queued_tasks

Number of tasks in the QUEUED state at any given instance.

Release files for airflow-prometheus-exporter 1.0.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for airflow-prometheus-exporter 1.0.8
File Size Uploaded
airflow_prometheus_exporter-1.0.8.tar.gz 6.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for airflow-prometheus-exporter 1.0.8
File Interpreter ABI Platform
airflow_prometheus_exporter-1.0.8-py3-none-any.whl Python 3 none any Details

Total release size: 14.9 kB

Release files / airflow_prometheus_exporter-1.0.8.tar.gz

Download URL airflow_prometheus_exporter-1.0.8.tar.gz
Size 6.2 kB
Tags Source
SHA-256 checksum
How to use checksums
ac6f41c0c23e00e9f8c12a97330fd91220ddc84485460882f18c0df02d3d696f
BLAKE2b-256 checksum
How to use checksums
2b6aba5031cd8b10f9ed8cdc6915c2ec2366770a74268f7f8af367e412bb9040
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.5

Release files / airflow_prometheus_exporter-1.0.8-py3-none-any.whl

Download URL airflow_prometheus_exporter-1.0.8-py3-none-any.whl
Size 8.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
154f238177a866d03d2c0581e0a6ef939b2032a83db4910f80b384c5d5d8ec82
BLAKE2b-256 checksum
How to use checksums
d050ecd869b1e06130cc8abf78f59cd6b58fd43ef65e42a695a59be3d2b0bc47
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.5

Release history Release notifications | RSS feed

This release

1.0.8 This release

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page