Integrating Error Notifiers to Slack

In this document, we'll walk through the process of creating a Slack Notifier, after which it can be used in any number of deployments to send alerts to the configured Slack channel upon the occurrence of an Application Error and/or a Custom Log Event Error. For more on the different kinds of errors, see Logging Errors. For more on tying Notifiers to a deployment, see Publish and Manage Deployments.

Pre-requisites:

Before starting the configuration, create an #app-errors channel in Slack to receive the error messages.

Creating a Slack App

To post messages from apps into Slack, a Slack App must be created with an Incoming Webhook. 

  1. Go to https://api.slack.com/messaging/webhooks#getting_started, click on Create your Slack app, and then choose to create it from scratch. A modal will show up prompting you to name your app and then pick the workspace you’ll be using. Once you have done so, click on Create App:
C.png
  1. Turn Incoming Webhooks on.
organizing info
  1. Enter the Slack channel where notifications will be posted to.
organizing info
  1. Copy the Slack app URL. 

F.png

We recommend pasting the URL in the channel’s topic since it will be needed later on to create the App Notifier in the Console.

Create a Slack Notifier in the Console

  1. Go to Console > Settings > Logs and Notifiers.
organizing info
  1. Scroll down to the Notifiers section and click on the associated Create new button.
organizing info
  1. Clicking on this button will open the Inspector, which will contain the tools to define the details of the new notifier being created. Select Slack as the Destination. In the URL field, paste the Slack app URL you copied in the previous section. In the Name field, given your notifier a name. In the following example, the notifier is called "App Notifier". When all three fields are filled in, click on the "Create" button to the bottom right of the Inspector:

HH.png

A Send Test button will show up for you to click and receive a Test text on the #app-errors channel: 

I.png

You have now created a Slack Notifier! All apps within your Organization will have access to this notifier. It can be used by any app to send errors of either kind.