In the Notification Service section of the Create alert policy window, select the Slack option.
In the field that displays, enter the name of the Slack channel you added the @Dagster Cloud bot user to.
Note: One channel is allowed per alert policy. To post alerts to multiple channels, first invite the @Dagster Cloud bot and then create a new alert policy that posts to that channel.
To define a Slack alert policy in code, use the following keys to configure the alert:
notification_service.slack.slack_workspace_name - The name of the Slack workspace connected to Dagster Cloud
notification_service.slack.slack_channel_name - The name of the Slack channel the @Dagster Cloud user is a member of
# alert_policies.yamlalert_policies:-name:"slack-alert-policy"description:"An alert policy to send a Slack notification to sales on job failure or success."tags:-key:"team"value:"sales"event_types:-"JOB_SUCCESS"-"JOB_FAILURE"notification_service:slack:slack_workspace_name:"hooli"slack_channel_name:"sales-notifications"
Then, use the dagster-cloud CLI to set the alert policies for the deployment:
dagster-cloud deployment alert-policies sync -a /path/to/alert_policies.yaml
To disconnect Dagster Cloud from Slack, remove the Dagster Cloud app from your Slack workspace. Refer to Slack's documentation for more info and instructions.
Once the app is removed, refresh the Alerts page in Dagster Cloud and the Connect to Slack option will be displayed.