Added Pagerduty Support

@nemo83 nemo83 released this Jan 26, 2017 · 1 commit to master since this release

Pagerduty Support

Added Pagerduty support for failing jobs. Since the ProcessDefinition json object was already catering for subscriptions (aka emails), a broader redesign was required.

The subscription json object has been deprecated and removed from the ProcessDefinition and a brand new, more generic and polymorphic notifications array has been added.

Currently the only two possible types of notifications are:

  • Email (that has exactly the same shape of the subscription)
  • Pagerduty

Pagerduty notifications

A simple example of notifications in the process definition of a job could look like:

"notifications": [
      "email": {
        "name": "name",
        "email": "email",
        "notify_when": "on_state_change_and_failures"
      "pagerduty": {
        "service_key": "my_pd_service_key",
        "num_consecutive_failures": 3,
        "api_url": ""

The configuration is really simple and the only field worth to mention is num_consecutive_failures.

The num_consecutive_failures field defaults to 1 and represents the number of consecutive times the whole job has to fail before a PD alert is actually fired. In case of a failure of a single task no alert will be raised. If the failure in completing a task is supposed to trigger an alert, the flag:

 "require_explicit_success": false

can be used.


Changes are backward compatible. Existing email subscriptions are now automatically treated as EmailNotifications so previously process definitions should work after updating to latest Sundial, but when creating a new process definition, you need to rename subscriptions to notifications.