Processing data with Kapacitor on InfluxCloud
There is a free, limited edition of Kapacitor included with every InfluxCloud subscription. It is already up and running, so go ahead and access it’s capabilities via Chronograf. By design, it is limited – to roughly 25 alerts or other simple tasks – in terms of it’s capabilities.
You can also purchase a Kapacitor add-on which unlocks the full programmatic access and expanded processing power of this component of the TICK stack. A Kapacitor add-on for InfluxCloud can perform various operations on your time series data stored in InfluxDB. Kapacitor is InfluxData’s data processing framework that makes it easy to create sophisticated downsampling jobs, perform forecasting, integrate with machine learning tools and, of course, detect anomalies and create alerts. The next steps will get you up and running with a Kapacitor add-on for your InfluxCloud subscription.
Note: Currently, InfluxCloud’s Kapacitor add-ons do not support the User Defined Functions (UDF) available in the OSS version of Kapacitor.
You can do this from your InfluxCloud subscription management page by clicking on the Kapacitor Add-on
A series of Kapacitor subscription options appear. Select the option which best suits your needs.
If you have one of the larger InfluxCloud subscriptions, we recommend choosing at least the Standard I plan to start with.
Note: There are no free trials for Kapacitor (a free, limited edition is already included with your subscription). Even if you are using a free trial subscription for InfluxCloud, if you decide you want to explore your InfluxCloud subscription using Kapacitor, you will be charged the associated monthly or annual fee if you purchase the Kapacitor Add-on.
You can select either a monthly or annual plan. When you click the
Buy Kapacitor button, you will be charged
the amount shown on the screen.
Once you’ve made your purchase, you will be returned to the InfluxCloud subscription management page.
On this page, you should see an animated image while InfluxCloud spins up your new Kapacitor Add-on.
Once the Kapacitor icon appears (as shown below) you are ready to get started.
There are two ways to connect to your Kapacitor Add-on:
To do this, you will need three important pieces of information:
First, you can find the
Kapacitor URL on the Kapacitor Add-on details page by
clicking on the Kapacitor Add-on icon shown below:
Once you clicked on the icon, the Kapacitor details page will appear, showing the URL for your Kapacitor Add-on along with some other details.
Next, click the
Launch Chronograf button under Quick Links. This will open a new window for Chronograf. Once you are in the Chronograf page, log-in and
navigate to the
Configuration page by clicking the gear shaped icon on the left hand navigation panel.
Configuration page, you will see the pre-configured InfluxDB data source connected along with the default “My Kapacitor”, which is
included with the subscription. If you click on the triangle in the blue box surrounding “My Kapacitor”, it will drop-down as shown above. Click on
Add Kapacitor and the following screen will appear:
Kapacitor URL, enter the URL you captured from the Kapacitor Add-on details page and make sure to include Kapacitor’s default port:
9092. Next, give your Kapacitor Add-on a name. This can be anything you want – except
My Kapacitor – which would make it confusing as to which Kapacitor instance you were working with: the free, limited one provided with your subscription or the Add-on.
Next enter the InfluxDB admin username and password you provided during the subscription setup process. Finally, click Connect.
When Kapacitor successfully connects, Chronograf automatically opens the Configure Alert Endpoints section. Kapacitor supports several alert endpoints/event handlers. See the Configure Kapacitor Event Handlers guide for more information.
How can I tell that Kapacitor is running?
Like InfluxDB, Kapacitor supports a
ping endpoint to test if the Kapacitor Add-on is up and running.
Here we can just use
curl to hit the ping endpoint.
Alternatively you can use the CLI program to ask for some general information about Kapacitor.
kapacitor stats general
As long as no errors are returned from either of the above commands, your Add-on is running.
How do I add a new task?
Navigate to the Alerting section of the left hand navigation bar by selecting the triangle with the exclamation point then select Alert Rules as shown below.
Next click on the
Create Rule button in the upper right-hand corner of the page and the alert rule wizard will appear.
This allows you to quickly create your first task in Kapacitor.
A task in Kapacitor defines an operation you want to perform on your time series data. A task has a few properties:
- Type – Whether your task is a stream or a batch operation.
- TICKscript – A TICKscript that defines the operation you want to perform.
- DBRP – The database and retention policy that your task will use.
First save your TICKscript into a file. By convention, we only use a
.tick extension when saving TICKscript files.
Then using the CLI define the task and its properties:
kapacitor define <NAME_OF_TASK> \ -type <stream|batch> \ -tick path/to/tickscript/task.tick \ -dbrp mydb.myrp
How do I see what tasks are loaded?
To see which tasks you have already created and some basic information about them run:
kapacitor list tasks
How do I run a task?
Before a task actually does any work it must first be enabled. Using the CLI again, run this command to enable a task:
kapacitor enable <NAME_OF_TASK>
How do see the status of my task?
To see what your task is doing run:
kapacitor show <NAME_OF_TASK>
This will output information about your task: its type, status, TICKscript, any error it may have encountered, and stats about the data it has processed. When debugging a task, the output of the show command is invaluable.
Where can get additional information?
The questions above cover the basics of using the KapacitorCLI. To learn more about what you can do with Kapacitor run: