8.3.1 Configuring Slack notifications

Slack webhooks allow Telebugs to send error notifications directly to a Slack channel or user. This integration provides real-time alerts, enabling teams to monitor and respond to errors efficiently.

Configuring a Slack webhook

To configure a Slack webhook in Telebugs, follow these steps:

  1. In your Slack workspace, right-click on a channel name and select View channel details. Slack channel dropdown
  2. Select Integrations tab to add the app. Select Integrations tab
  3. Click the Add an app button to open the Slack App Directory. Add an app button
  4. Search for Incoming Webhooks and select it from the search results, then click Install. Install Incoming Webhooks app
  5. Click Add to Slack to create a new webhook configuration. Add to Slack button
  6. Choose the channel where notifications will be posted (e.g., "#telebugs") from the Post to Channel dropdown. Select channel for webhook
  7. Confirm the channel and click Add Incoming Webhooks integration. Add Incoming Webhooks integration
  8. Copy the generated webhook URL from the Setup Instructions section. Copy webhook URL

Completing the webhook configuration in Telebugs

Navigate back to Telebugs to complete the webhook configuration:

  1. In Telebugs, go to Notification Configuration and select Webhooks.
  2. Click Create Configuration and choose Slack as the template type. Select Slack template type
  3. Enter the webhook URL from Slack into the Webhook URL field and optionally provide a name (e.g., "#errors").
  4. The template body will auto-fill with a Slack-compatible payload, which you can customize as needed.
  5. Save the configuration by clicking Save webhook.
  6. Test the webhook by clicking the Test button to ensure it posts to your Slack channel correctly.
  7. When an error occurs, Telebugs will send a notification to the specified Slack channel using the configured webhook URL. Telebugs Slack notification example

Here’s an example of a Slack-compatible payload:

{
  "username": "Telebugs",
  "attachments": [
    {
      "fallback": "{{project_name}}: {{trigger}} - {{error_type}}: {{error_message}}",
      "pretext": "*{{trigger}}* from <{{project_url}}|{{project_name}}>",
      "color": "#D00000",
      "fields": [
        {
          "title": "{{error_type}}{{culprit}}",
          "value": "{{error_message}}",
          "short": false
        },
        {
          "title": "Location",
          "value": "{{location}}",
          "short": false
        }
      ],
      "actions": [
        {
          "type": "button",
          "text": "View",
          "url": "{{view_url}}"
        }
      ]
    }
  ]
}

You can customize the payload however you like, using the available keys to include dynamic values from the error report (see Webhook template body placeholders). For example, you can change the color, add more fields, or modify the message format.