Registry / workflow / apache-airflow-providers-pagerduty

apache-airflow-providers-pagerduty

JSON →
library5.2.6pypypi✓ verified 8d ago

The `apache-airflow-providers-pagerduty` package provides Apache Airflow integrations for PagerDuty, enabling users to send incident notifications and interact with the PagerDuty API directly from Airflow DAGs. It supports both the PagerDuty REST API and Events API. The current version is 5.2.4 and it follows the Apache Airflow provider release cadence, with frequent updates addressing features, bug fixes, and compatibility.

pip install apache-airflow-providers-pagerduty
INSTALL
IMPORT
SIG · APACHE-AIRFLOW-PRO
A
apache-airflow-providers-pagerduty
workflowpythonv5.2.6
Install
26.2s avg
Import
5181ms
Disk
266MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v5.2.6 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 5.402s · 267.6MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 26.2s · import 4.960s · 267MB
266MB installed
● package 266MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

PagerdutyHook
from airflow.providers.pagerduty.hooks.pagerduty import PagerdutyHook
send_pagerduty_notification
from airflow.providers.pagerduty.notifications.pagerduty import send_pagerduty_notification
PagerdutyNotifier
from airflow.providers.pagerduty.notifications.pagerduty import PagerdutyNotifier
from airflow.providers.pagerduty.notifications import PagerdutyNotifier
Import from the specific 'pagerduty' module within 'notifications'.

This quickstart demonstrates how to use `send_pagerduty_notification` as an `on_failure_callback` for both a DAG and a specific task. Ensure you have configured a PagerDuty connection in Airflow (Admin -> Connections, type 'Pagerduty' or 'Pagerduty Events') or provide the `integration_key` directly. For security, it's recommended to store sensitive keys in Airflow Connections or a secret backend, and retrieve them via `BaseHook.get_connection`.

import os from datetime import datetime from airflow.models.dag import DAG from airflow.operators.bash import BashOperator from airflow.providers.pagerduty.notifications.pagerduty import send_pagerduty_notification PAGERDUTY_INTEGRATION_KEY = os.environ.get('PAGERDUTY_INTEGRATION_KEY', '') with DAG( dag_id='pagerduty_notification_example', start_date=datetime(2023, 1, 1), schedule=None, catchup=False, tags=['pagerduty', 'notification'], on_failure_callback=[ send_pagerduty_notification( summary="The DAG {{ dag.dag_id }} failed!", severity="critical", source="airflow dag_id: {{dag.dag_id}}", dedup_key="{{dag.dag_id}}-failure", component="airflow", integration_key=PAGERDUTY_INTEGRATION_KEY, ) ] ) as dag: start_task = BashOperator( task_id='start_task', bash_command='echo "Starting DAG..."', ) failing_task = BashOperator( task_id='failing_task', bash_command='exit 1', # This task will intentionally fail on_failure_callback=[ send_pagerduty_notification( summary="Task {{ ti.task_id }} failed in DAG {{ dag.dag_id }}", severity="error", source="airflow task_id: {{ti.task_id}}", dedup_key="{{dag.dag_id}}-{{ti.task_id}}-failure", component="airflow", integration_key=PAGERDUTY_INTEGRATION_KEY, ) ] ) success_task = BashOperator( task_id='success_task', bash_command='echo "DAG succeeded!"', ) start_task >> failing_task >> success_task
Debug
Known issues
breakingProvider version 5.0.0 removed all deprecated classes, parameters, and features. Ensure your code does not rely on any previously deprecated components.
fix
Refer to the official changelog for specific removals. Update your code to use current API methods.
affects: >=5.0.0
breakingMinimum Apache Airflow version required is 2.11.0. Older Airflow versions are not supported.
fix
Upgrade your Apache Airflow environment to at least version 2.11.0. If upgrading from Airflow <2.1.0, an `airflow upgrade db` might be necessary.
affects: <5.0.0 requires Airflow <2.1.0, >=5.0.0 requires >=2.1.0, >=5.2.4 requires >=2.11.0
breakingPython 3.9 support was dropped with version 5.0.1. Ensure your environment uses Python 3.10 or newer.
fix
Upgrade your Python environment to version 3.10 or later.
affects: >=5.0.1
gotchaWhen configuring a PagerDuty connection in Airflow, there are two main types: 'Pagerduty' for the REST API (requires an API token in the 'Password' field) and 'Pagerduty Events' for the Events API (requires an Integration Key). Using the wrong type or credential will lead to authentication failures.
fix
Select the correct connection type in the Airflow UI (Admin -> Connections) and provide the corresponding API token or Integration Key in the designated field. For Events API, the integration key can often be passed directly to the `send_pagerduty_notification` function.
affects: All versions
gotchaAn issue (reported in Jan 2025 as #45626) indicated that the `PagerdutyNotifier` class's `notify` method was attempting to use a `create_event` method that no longer existed, leading to failed notifications. While this might be resolved in current versions, using the `send_pagerduty_notification` function directly in callbacks is often a more robust and commonly demonstrated approach.
fix
Prefer using the `send_pagerduty_notification` function for DAG/task callbacks. If using `PagerdutyNotifier`, ensure your provider version is sufficiently updated and test the notification flow thoroughly.
affects: Potentially provider versions around 4.x - 5.0.x (check specific patch notes for resolution)
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'airflow.providers.pagerduty'
The 'apache-airflow-providers-pagerduty' package is not installed or not properly configured.
fix
Install the package using 'pip install apache-airflow-providers-pagerduty'.
ImportError: cannot import name 'PagerdutyHook' from 'airflow.providers.pagerduty.hooks.pagerduty'
The 'PagerdutyHook' class has been moved or renamed in recent versions of the provider package.
fix
Update the import statement to 'from airflow.providers.pagerduty.hooks.pagerduty import PagerDutyHook'.
AttributeError: 'PagerdutyHook' object has no attribute 'create_event'
The 'create_event' method has been deprecated and removed in favor of 'send_event'.
fix
Replace 'create_event' with 'send_event' in your code.
TypeError: send_event() missing 1 required positional argument: 'event'
The 'send_event' method requires an 'event' argument that was not provided.
fix
Ensure you pass the required 'event' argument when calling 'send_event'.
RuntimeError: The package 'apache-airflow-providers-pagerduty' needs Apache Airflow 2.11.0+
The installed version of Apache Airflow is lower than the required version for this provider package.
fix
Upgrade Apache Airflow to version 2.11.0 or higher.
Upgrade
Version history
5.2.6latest on PyPI · released Jun 7, 2026
Audit
Dependencies
apache-airflowrequiredCore Apache Airflow library, required for all providers.
pagerdutyrequiredOfficial PagerDuty Python client library used by the provider.
apache-airflow-providers-common-compatoptionalProvides common compatibility features for providers, used with `[common.compat]` extra.
apache-airflow-providers-httpoptionalProvides HTTP connection functionality, used with `[http]` extra.
Agent activity
57 hits · last 30 days
node
48
Amazon
1
Resources
apache-airflow-providers-pagerduty — pip install apache-airflow-providers-pagerduty · libregistry