Pagerduty¶
Notify Pagerduty of a new alert status. If alert is active, then a new pagerduty incident with type trigger
will be sent. If alert is inactive then incident type will be updated to resolve
.
Note
Pagerduty notification plugin uses API v2.
-
notify_pagerduty
(message='', per_entity=False, include_alert=True, routing_key=None, alert_class=None, alert_group=None, **kwargs)¶ Send notifications to Pagerduty.
Parameters: - message (str) – Incident message. If empty, then a message will be generated from the alert data.
- per_entity (bool) – Send new alert per entity. This affects the
dedup_key
value and impacts how de-duplication is handled in Pagerduty. Default isFalse
. - include_alert (bool) – Include alert data in incident payload
custom_details
. Default isTrue
. - routing_key (str) – Pagerduty service
routing_key
. If not specified, then the service key configured for the worker will be used. - alert_class (str) – Set the Pagerduty incident class.
- alert_group (str) – Set the Pagerduty incident group.
Example:
notify_pagerduty(message='Number of failed requests is too high!', include_alert=True, alert_class='API health', alert_group='production')