Skip to main content

Airflow plugin to export dag and task based metrics to Prometheus.

Project description

Airflow prometheus exporter

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

Compatibility with Airflow versions

3.*

Versions >=2.0.0 will support only Airflow 3.0+

2.*

Versions >=1.7.0,<2 are compatible with Airflow 2.*

Development of Airflow 2 compatible version happens from airflow-2 branch

Install

pip install airflow-exporter

That's it. You're done.

Exporting extra labels to Prometheus

It is possible to add extra labels to DAG-related metrics by providing labels dict to DAG params.

Example

dag = DAG(
    'dummy_dag',
    schedule_interval=timedelta(hours=5),
    default_args=default_args,
    catchup=False,
    params={
        'labels': {
            'env': 'test'
        }
    }
)

Label env with value test will be added to all metrics related to dummy_dag:

airflow_dag_status{dag_id="dummy_dag",env="test",owner="owner",status="running"} 12.0

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 a specific status.

airflow_dag_status

Labels:

  • dag_id
  • owner
  • status
  • paused

Value: number of dags in a specific status.

airflow_dag_run_duration

Labels:

  • dag_id: unique identifier for a given DAG

Value: duration in seconds of the longest DAG Run for given DAG. This metric is not available for DAGs that have already finished.

airflow_dag_last_status

Labels:

  • dag_id
  • owner
  • status
  • paused

Value: 0 or 1 depending on wherever the current state of each dag_id is status.

The "last" DAG run is the one with the most recent updated_at (not logical_date, which is NULL for manually triggered runs).

License

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

airflow_exporter-2.1.0.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

airflow_exporter-2.1.0-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file airflow_exporter-2.1.0.tar.gz.

File metadata

  • Download URL: airflow_exporter-2.1.0.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for airflow_exporter-2.1.0.tar.gz
Algorithm Hash digest
SHA256 f60e4cd15dcc1986912913de0c897fdad314eafb517f328ee4d60d4c29c200d4
MD5 5010cfa409d1a9f7545788bbca9db0b1
BLAKE2b-256 9c8fb529f65926f756bfad2d6c755d9133e20b52d59acc5a1475fad71b2808e0

See more details on using hashes here.

Provenance

The following attestation bundles were made for airflow_exporter-2.1.0.tar.gz:

Publisher: publish.yml on epoch8/airflow-exporter

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file airflow_exporter-2.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for airflow_exporter-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 acced2ef4446e18cd97417896e3f24985e08d61fa824bed63470d44cdcad4623
MD5 1a7563394e3f3984c1f51c6917a66169
BLAKE2b-256 9ca568e819e2d6498aec35b194c190cbfcf189398bb2f9e8085a4c52536140a7

See more details on using hashes here.

Provenance

The following attestation bundles were made for airflow_exporter-2.1.0-py3-none-any.whl:

Publisher: publish.yml on epoch8/airflow-exporter

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page