Overview

Routers are objects that can dynamically route alerts and notifications based on conditions.

Management

Note: Routers require Administrator permissions and the Pro pricing plan.

Create A Router

  1. Enable Advanced Mode
  2. From the action button, click the Create Router button. Create Stakeholder Button
  3. Provide the following:
    • Name - The name of the router (ex: “Dev Alerts Router”)
    • Type - Select the type. This can be “Routing Rules” which are generally connected as alert filters connected to integrations, or “Notification Rules” which are rules specifying how users should be notified and are attached to users.
    • Default Destination - (only applicable to “Routing Rules”) - The default destination to send the alert if no rules match.
  4. Click Save button. Create Router Form

Update A Router

  1. Navigate to the router page you would like to edit.
  2. Next to any of the fields double click to edit or just toggle the swtich. Modify Router Attributes

Delete A Router

Note: Deleteing a router that is being used by another object (integration, user, ext.) could have unintended consequences. Make sure other ojects are not using this router before deleting it.
  1. Navigate to the Routers page.
  2. Click the trashcan button next to the router you wish to delete. Click Trashcan Button
  3. Click the Yes button to confirm you would actually like to delete this router. Confirm Delete

Formats

Rules

All routers use YAML as the format. The root element should always be rules (array). Each rule has a match condition (object) and a actions (array). See the routing rules and notification rules sections for examples.

Please Note: When rules are evaluated, they will be evaluated in order. Only the first matching rule will be used.

Data

When routers are matching rules they are given access to data. Namely you are given access to the alert in context, and a special field always which is always true (especially useful for catch all rules).

Operators

Internally PagerTree uses the sift package to do rule matching. It follows the familiar MongoDB syntax.

There are 2 special functions $day and $timeBetween that are supplimental. See below for documentation.

$day

The day operator returns the current ISO day of the week (1 Monday, 7 Sunday). You can then use other operators to match the current day.

Make sure to provide the timezone parameter, if not it will default to Etc/UTC. You can use any of the momentjs timezones.

$timeBetween

The timeBetween operator returns a boolean. true if the current time is between (inclusive) the time provided, false otherwise.

Make sure to provide the timezone (default: ‘Etc/UTC’), timeformat (default: ‘hh:mm a’), starttime, and endtime parameters.

Routing Rules

With routing rules, you can perform complex routing and actions on alerts. Actions include:

  • aggregate - Aggregate alerts based on field(s)
  • assign - Assign the alert to a team, user, schedule, or another router
  • automate - Run an automation
  • setval - Set a value on the alert
  • stakeholder - Attach a stakeholder to the alert
  • ignore - Suppress the alert

Aggregate

The aggregate function will aggregate alerts by the specified by properties for timeout time. All subsequent alerts that arrive will be added as a child to the first alert. They can be found in the children tab of the UI and will show a status of suppressed. After the timeout elapses (since the first alert), it will then route the alert to the receiver.

Assign

The assign function will assign the alert to a team, user, schedule, or another router (can only go 10 routers deep). This is useful for dynamic routing based on conditions.

Automate

The automate action will run automations when triggered. Provide the ids of the automations to run.

SetVal

The setval action will assign data to the alert. Use the map attribute to define custom title, description, tags, or urgency.

Stakeholder

The stakeholder action will attach stakeholders to the alert when triggered. Provide the ids of the stakeholders to attach.

Ignore

The ignore action will place the alert into a suppressed state and stop routing.

Example Templates

Notification Rules

With notification rules, you can perform custom notification sequences. Actions include:

  • notiy - Notify on specified channels
  • repeat - Repeat the notification sequence
  • ignore - Suppress notifications from being sent

Notify

The notify action will notify the user on specified channels then wait for a timeout for next instructions. Possible values for the channels parameter are:

  • push
  • email
  • sms
  • voice
  • slack

Repeat

The repeat action will repeat the above notify actions n times. You can repeat between 0 and 3 times.

Ignore

The ignore action will supress sending any notififications to the user when matched.

Example Templates