Slack App Incoming Webhook Integration

Prev Next

Introduction

Slack is a messaging app that brings all your team’s communication and files in one place, where they are instantly searchable and available wherever you go. It delivers alerts with all the supporting information to the right people, enabling them to assess the incident and take appropriate actions rapidly.

This integration allows you to send Catchpoint Alerts into a Slack app with incoming webhooks.

Prerequisites

  • Slack admin account privileges.
  • Slack channel to receive push notifications.
  • Catchpoint Alert Webhook page access.
  • Test set up in Catchpoint portal with alerts.

Installation & Configuration

Configuration is Slack.

  1. Open Slack API page.

  2. Sign into your Slack account.

  3. Select your workspace.

  4. Navigate to your apps page.

  5. Click on Create New App.
    **

  6. Choose From Scratch.
    **

  7. Enter an App Name.

  8. Pick a workspace from the dropdown.
    blobid1.png **

  9. Click Create App.

  10. Click on Incoming Webhooks on the left nav bar.

  11. Activate incoming webhook.
    **

  12. Click Add New Webhook to Workspace at the bottom of the page.

  13. Select the channel when we need to post the Catchpoint alerts.


15. Click Allow and it will install the new app in your channel.
16. This will create a new Webhook URL. Click Copy to copy the webhook URL.

Configuration in Catchpoint Portal - Alert Data Webhook:

  1. Log into the Catchpoint Portal, then go to Integrations > API.
  2. Click Add URL, under Alert Data Webhook.
  3. Enter a Name.
  4. Enter URL, paste the webhook URL copied from Slack app.
  5. Select Template under Format.
  6. Click Add New, to create a new template.
  7. Enter a template Name.
  8. Select Format as JSON.
  9. Paste the below sample template:
{
    "blocks": [{
            "type": "divider"
        }, {
            "type": "section",
            "text": {
                "type": "mrkdwn",
                "text": "*${switch('${notificationLevelId}','0','WARNING','1','CRITICAL','3','IMPROVED')}*: ${Switch(${AlertTypeId},'0', 'Unknown','2', 'Byte Length','3', 'Content Match','4', 'Host Failure','7', 'Timing','9', 'Test Failure', '10', 'Insight', '11','Javascript Failure', '12', 'Ping',13, 'Requests', '14', 'Zone', '15', 'Availability', '16', 'IP Adrdress', 'Other')} - ${switch(${AlertSubTypeId},'0','','1','Test URL','2','Page','10','Regular Expressions','11','Compare to Previous','12','Compare to File','40','Unknown','50','DNS','51','Connect','52','Send','53','Wait','54','Load','55','TTFB','57','Content Load','58','Response','59','Page Response','61','DOM Load','62','Perceived Page Load','63','Page Response/Suspect','64','Server Response','90','Tracepoints','91','Indicators','100','Ping RTT','101','Ping Packet Loss','110','# Requests','111','# Hosts','112','# Connections','113','# Redirects','114','# Other','115','# Images','116','# Scripts','117','# HTML','118','# CSS','119','# XML','120','# Flash','121','# Media','130','Page Response','131','Bottleneck time','132','% Bottleneck','133','# Requests','134','# Failures','140','Test','141','Content','150','Test URL','151','Child URLs','152','Any URL', 'Other')} Alert"
            }
        }, {
            "type": "section",
            "text": {
                "type": "mrkdwn",
                "text": "<${testLink}|${testName}> [<${testLink}|${testId}>]\nURL: ${TestUrl}\nNode ID: ${NodeDetails('${NodeId}, ')}"
            }
        }, {
            "type": "image",
            "image_url": "${AlertScatterplotImageUrl}",
            "alt_text": "scatterplot"
        }, {
            "type": "section",
            "text": {
                "type": "mrkdwn",
                "text": "<${smartboardUrl}|Smartboard> | <${scatterplotChartURL}|Explorer> | <${waterfallChartURL}|Records>"
            }
        }
    ]
}

  1. Click Save.
  2. Select the newly created template.
  3. Add an email address to On Failure Alert.
  4. Check apply to all alerts if required.
  5. Click Save.

Results

Once the test alerts are triggered the data will be pushed into the configured Slack channel as below:

mceclip0.png