Skip to main content

Airflow plugin for automatically sending metrics from Airflow to Datadog

Project description

Build Status

airflow-metrics

airflow-metrics is an Airflow plugin for automatically sending metrics from Airflow to Datadog.

Tested For: apache-airflow>=1.10.2, <=1.10.3

Installation

pip install airflow-metrics

Optional

If you want to the metrics from BigQueryOperator and GoogleCloudStorageToBigQueryOperator, then make sure the necessary dependencies are installed.

pip install apache-airflow[gcp_api]

Setup

airflow-metrics will report all metrics to Datadog, so create an airflow connection with your Datadog api key.

airflow connections --add --conn_id datadog_default --conn_type HTTP --conn_extr '{"api_key": "<your api key>"}'

Note: If you skip this step, your airflow installation should still work but no metrics will be reported.

Usage

That's it! airflow-metrics will now begin sending metrics from Airflow to Datadog automatically.

Configuration

By default, airflow-metrics will begin extracting metrics from Airflow as you run your DAGs and send them to Datadog. You can opt out of it entirely or opt out of a subset of the metrics by setting these configurations in your airflow.cfg

[airflow_metrics]

airflow_metrics_enabled = True
airflow_metrics_tasks_enabled = True
airflow_metrics_bq_enabled = True
airflow_metrics_gcs_to_bq_enabled = True
airflow_metrics_requests_enabled = True
airflow_metrics_thread_enabled = True`

Limitations

airflow-metrics starts a thread to report some metrics, and is not supported when using sqlite as your database.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Getting Started

Set up your virtual environment for python3 however you like.

pip install -e .
airflow initdb
airflow connections --add --conn_id datadog_default --conn_type HTTP --conn_extr '{"api_key": ""}'

Note: The last step is necessary, otherwise the plugin will not initialize correctly and will not collect metrics. But you are free to add a dummy key for development purposes.

Running Tests

pip install -r requirements-dev.txt
pytest

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-metrics-0.1.3.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

airflow_metrics-0.1.3-py3-none-any.whl (15.9 kB view details)

Uploaded Python 3

File details

Details for the file airflow-metrics-0.1.3.tar.gz.

File metadata

  • Download URL: airflow-metrics-0.1.3.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 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.8

File hashes

Hashes for airflow-metrics-0.1.3.tar.gz
Algorithm Hash digest
SHA256 05c2b1e7653f7bef2360f1c38e2049670ed2b35baffc04fae042ff6cb1649beb
MD5 f5816ff278ca960c9a660bcb18f53ca7
BLAKE2b-256 3c26086884943ee70aa5183a857ea61fec949760f922931ca0f0b01749f5ab95

See more details on using hashes here.

Provenance

File details

Details for the file airflow_metrics-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: airflow_metrics-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 15.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 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.8

File hashes

Hashes for airflow_metrics-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 42799f5ed3ad47e4cc6c1a7063faabba5ce8f9a24bc3a1f58f33d93959367fd9
MD5 0905264f356e448846a68e6c1ddb6b25
BLAKE2b-256 6dbe4e9221598bb452e69f07233d68706523d56714f29b642617cf17131f1634

See more details on using hashes here.

Provenance

Supported by

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