Kapacitor Integration Guide
Kapacitor is an open source data processing framework that makes it easy to create alerts, run ETL jobs and detect anomalies. It can process both stream and batch data from InfluxDB. It lets you plug in your own custom logic or user-defined functions to process alerts with dynamic thresholds, match metrics for patterns, compute statistical anomalies, and perform specific actions based on these alerts like dynamic load rebalancing.
Kapacitor triggers alerts when alert rules are triggered. PagerTree acts as the dispatcher for these alerts, determining the right people to notify based on on-call schedules. PagerTree notifies them via email, sms, voice, and/or push notifications until the alert is acknowledged.
The Kapacitor integration is one-way, meaning:
- When an alert is not OK (
level !== 'OK') in Kapacitor, an alert is created in PagerTree automatically.
- When an alert is OK (
level === 'OK') in Kapacitor, the alert is resolved in PagerTree automatically.
In this integration tutorial we will show you how to send alerts from Kapacitor into PagerTree. The estimated time for this integration is 5 minutes. We assume that you already have a PagerTree and Kapacitor setup. We also assume you are familiar with the TICK stack since we will be using several of these components to setup the Kapacitor integration.
- From the integrations page, click the New Integration” button
- Click the logo of the Type of integration you want to create
- In the “Create Integration” form, fill out the following:
- Name of the Integration.
- Select an appropriate Urgency for when this integration is triggered
- Select the Team this alert will be assigned to
- Any additional options requested by the integration
- Click Create
- Copy the Endpoint URL
- From your Chronograph dashboard, in the left hand menu, select Alerting -> Manage Tasks.
- Click the Write TICKscript button.
- In the TICKscript editor:
- Select a database.
- Title your TICKscript (e.g. “high_cpu”).
- Copy and paste the following code, replacing the pagertree_url value with the PagerTree Endpoint URL you copied earlier.
- Click the Save New TICKscript button
This tick script, uses InfluxDB’s sample Telegraph collector that merely collects CPU usage on your local machine. You’ll need to apply the alert to your own tickscripts to alert on metrics you wish to monitor. The important pieces to this script are:
You have successfully completed the Kapacitor Integration. Now when Kapacitor creates an alert, PagerTree will create an alert and route it to the correct team member that is on-call. If you have any questions please contact [email protected]
- cpu_alert.tick - Sample TICKscript to alert PagerTree using HTTP POST