Application programming interface or APIs offer extensibility, making it possible to connect multiple tools and analyze data from different channels for a more comprehensive performance analysis. Processes or functions built using APIs are used to exchange and manipulate data between disparate applications.

Catchpoint APIs are a simple, yet powerful mechanism to create external tools that can communicate with Catchpoint. We have used Catchpoint APIs to successfully integrate several popular tools used by our customers including PagerDuty, BigPanda, Sumologic, Chef, Splunk, etc. Our out-of-the-box integrations cover everything from alerting and notification tools to collaboration and other analytics tools. Read more about the integrations we support here.

We recently released another major integration, enabling on-demand URL testing directly inside a Slack chat channel. Slack is a communication tool widely used by most enterprises and helps different teams within the organization collaborate better.

On-demand testing

The on-demand feature in Catchpoint allows users to run an instant test using an API, where a test can run from public and Enterprise Nodes. These tests get priority over other tests in the system and will run immediately without waiting in the queue. After the completion of the test run, the test run data is available to be accessed over the API.

There are four different mechanisms to communicate with Catchpoint through API.

  • Test Data Webhook: Pushes raw data of each test run to a specified endpoint when configured.
  • Alert Webhook: Allows to push customized test data to an endpoint when an alert is triggered.
  • REST API: Using REST API we can pull specific data from Catchpoint based on the pull query. A user must authenticate before requesting any data.
  • Events API: Catchpoint Events allow you to post events from your change management, DevOps tools, or any other event-driven service directly to Catchpoint.

The on-demand Slack test runs on the REST API to establish a secure connection between Catchpoint and Slack.

How does it work?

Before we dive into the integration, let’s cover the setup and the concepts involved, starting with Slack.

  • Slack provides the ability to communicate with outside entities with the help of slash commands. A slash command begins with a slash (/) and behaves differently than normal command messages. For example, you can use the “topic” command to change the current Slack channel’s topic. The command /topic Hello! will change the topic to “Hello!”. With Slack, you can define custom slash commands with parameters to perform a defined action.
  • AWS Lambda function acts as a middleware, which takes input from Slack and then passes them to Catchpoint to run the tests. Once the results are ready, the Lambda function collects the test results and passes them back to Slack.
  • Catchpoint APIs are a great way to authenticate using OAuth 2.0 and request for specific information. This can be used to pull certain metrics for a timeframe, set up a new test, or run an instant test—depending on the use case.

catchpoint API example

Testing Slack

The on-demand test allows a user to quickly troubleshoot a site with an object monitor web test. In our integration, we have used an object monitor web test, which loads a single object based on the URL.

The test relies on REST API, a user can authenticate using a key and secret and later request for specific information. This mechanism will allow you to initiate an on-demand instant test run in Catchpoint and then fetch the run details and display it in a Slack channel.

run test catchpoint example

Slack slash commands initiate and pass required parameters to an instant test. The input for the command should be a URL followed by the Catchpoint Node ID. The URL should begin with a protocol, for example, http:// or https://. To get the Catchpoint Node ID, go the Nodes page in the Catchpoint Portal. Slash command is configured to send the details to an AWS Lambda function.

To implement this setup in AWS, first, a Lambda function needs to be created. After creation, it should be made accessible over HTTP/HTTPS via an AWS API gateway. The API gateway will provide an endpoint through which Slack can send the data to the Lambda function.

Once the function receives the data from Slack, it can process it, and forward those values to Catchpoint. The Lambda function will pass the URL and node ID and initiate an on-demand instant test run. After completion of the test run, it will post back the results to Slack.

The Lambda function accepts the data from the Slack channel and then, in turn, communicates with Catchpoint. Once the instant test is complete and tests run details are available, the Lambda function will post back the run details to the Slack channel.

ondemandtest example

Conclusion

Teams have incorporated Slack channels which get notified by Catchpoint alerts when they have availability issues. Alerts can be set to trigger when certain criteria are met, for example, alert on one failure or percentage of failures within a time frame. The settings can be customized much further based on requirements.

Once the team is notified by Catchpoint Alerts to the Slack channel, the first level of troubleshooting can begin right from Slack. A team member can quickly run an instant test to a specific URL on a particular Catchpoint Node and get the run details right in the chat window. The basic troubleshooting can be done without even logging into Catchpoint. This helps to quickly understand if a URL is accessible or not.

To further view the step-by-step guide to configure on-demand testing in Slack, please use this link.

 

This article was written by Loy Colaco of Catchpoint.