Routers are objects that can dynamically route alerts and notifications based on conditions.
Create A Router
- Enable Advanced Mode
- From the action button, click the Create Router button.
- 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.
- Click Save button.
Update A Router
- Navigate to the router page you would like to edit.
- Next to any of the fields double click to edit or just toggle the swtich.
Delete A Router
- Navigate to the Routers page.
- Click the trashcan button next to the router you wish to delete.
- Click the Yes button to confirm you would actually like to delete this router.
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.
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).
Internally PagerTree uses the sift package to do rule matching. It follows the familiar MongoDB syntax.
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.
The timeBetween operator returns a boolean.
true if the current time is between (inclusive) the time provided,
Make sure to provide the
timezone (default: ‘Etc/UTC’),
timeformat (default: ‘hh:mm a’),
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
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
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.
The automate action will run automations when triggered. Provide the
ids of the automations to run.
The setval action will assign data to the alert. Use the
map attribute to define custom
The stakeholder action will attach stakeholders to the alert when triggered. Provide the
ids of the stakeholders to attach.
The ignore action will place the alert into a
suppressed state and stop routing.
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
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:
The repeat action will repeat the above notify actions n
times. You can repeat between 0 and 3 times.
The ignore action will supress sending any notififications to the user when matched.