Notifications
You can set up an Alert Method if you want to be notified when Task Executions succeed, fail, timeout, stop sending heartbeats, or don’t start as scheduled. Additionally, for long-running services, you can configure CloudReactor to send notifications if the number of Task Executions providing the service goes below a minimum concurrency threshold.
Currently, we support two notification types:
- PagerDuty events. PagerDuty is powerful because it supports many ways of forwarding events once it receives them, for example sending an SMS message, sending an email, or sending a message to a Slack channel.
- Email messages
To have CloudReactor send Task and Workflow events to PagerDuty, follow these general steps:
- Create a PagerDuty Profile
- Create an Email Notification Profile
- Create an Alert Method
- Add the Alert Method to one or more Tasks or Workflows
Create a PagerDuty Profile
First, create a PagerDuty Profile that contains configuration on how to connect to your PagerDuty account.
- If you haven’t already, create an account with PagerDuty
- Login to your PagerDuty account
- Choose the menu option
Configuration ... Service Directory
. On that page select the+ New Service
button to add a new Service. - Name your Service anything you desire. Under Integration Settings … Integration Type, select “Use our API directly” and ensure that
Events API v2
is selected. If desired, adjust the Incident Settings. Finally, select theAdd Service
button at the page. - On the next page you’ll see your newly created Service along with an Integration Key. Copy the Integration Key for use in CloudReactor.
- In the CloudReactor website, select your username in the top right corner to reveal a dropdown menu. Select
PagerDuty profiles
. - On the next page, select the
Add PagerDuty Profile
button. - You’ll be taken to a form that lets you create the profile. Enter a name, and optionally a description. In the
Integration key
field, paste in the Integration Key you copied from PagerDuty in step 5. For theDefault event severity
field, choose the PagerDuty event severity to use for events with no explicit severity. By default, this isError
. - Select the
Save
button to save the profile
Create an Email Notification Profile
Alternatively, you can get notifications via email. In that case:
- In the CloudReactor website, select your username in the top right corner to reveal a dropdown menu. Select
Email Notification profiles
. - On the next page, select the
Add Email Notification Profile
button. - You’ll be taken to a form that lets you create the profile. Enter a name, and optionally a description.
- Optionally, choose a Run Environment to limit usage of the profile to Tasks running with the selected Run Environment
- Add email addresses to the To, CC, and BCC fields
- Select the
Save
button to save the profile
Create an Alert Method
Next, create an Alert Method that will link to the PagerDuty Profile or Email Notification Profile you just created.
- In the CloudReactor website, select your username in the top right corner to reveal a dropdown menu. Select
Alert methods
. - On the next page, select the
Add Alert Method
button. - You’ll be taken to a form that lets you create the Alert Method. Enter a name, and optionally a description.
- Leave the Enabled checkbox checked to ensure this Alert Method is fired when events occur.
- Check the boxes as desired to be notified on success, failure, and/or timeout
- Choose the desired event severity when:
- Scheduled Task or Workflow executions don’t start;
- Tasks do not send heartbeats on time; and
- A service goes down
For PagerDuty notifications:
- Select the PagerDuty notification method
- Select the PagerDuty Profile you created above.
For Email notifications:
- Select the Email notification method
- Select the Email Notification Profile you created above.
Finally, select the Save
button to save the Alert Method
Add the Alert Method to one or more Tasks or Workflows
Next, you just need to associate your Tasks or Workflow to the Alert Method you created.
Setting Alert Methods for Tasks
For Tasks, you can set the Alert Methods in the CloudReactor dashboard, or during deployment.
To use the dashboard:
- Go the list of your Tasks by going to the home page of CloudReactor
- Click on the Task you want to set the Alert Method on
- Click the
Alerts
tab - Check the checkboxes next to the Alert Methods you want to associate with the Task
- Hit the
Save changes
button
If you use the aws-ecs-cloudreactor-deployer Docker image to deploy your project, you can also set the Alert Methods of your Tasks during deployment. Normally, you will want to set different Alert Methods for each Run Environment in your deployment environment configuration file, for example deploy_config/staging.yml
. In that file you can set the alert methods for the whole deployment environment in default_env_task_config.alert_methods
, or per Task in task_name_to_env_config.<task_name>.alert_methods
. The alert_methods
property should be set to a list of the name(s) of the Alert Methods you created above.
Setting the Alert Method for Workflows
For Workflows, you can set the Alert Methods on the CloudReactor website:
- Go the list of your Workflows by selecting
Workflows
in the top navigation bar. - Click on the Workflow you want to set the Alert Method on
- On the Workflow detail page, click the
Settings
tab - For the
Alert Methods
field, check the checkboxes next to the Alert Methods you want to associate with the Workflow