How to get debugging information when developing a tick script for kapacitor?

I am wondering if, during tickscript development, is it possible to reset the state of a stream after passing through node processing (log to file, stdout)?

+6
source share
4 answers

I found it useful to put |httpOut('id') for debugging purposes. Later you can access http://kapacitor-host:9092/kapacitor/v1/tasks/<task_id>/<httpOut_id> and see what data goes through this node.

+3
source

Running the kapacitor show TASK_NAME should show you some information about the task itself, but in the DOT: section there is a description of the graph that contains statistics on how many data points have been reached that node.

Another way to debug would be to use InfluxDBOutNode to save points and see what is being processed. Hope this helps.

+1
source

Kapacitor has a Node log that allows you to dump the state of a stream into Kapacitor log files.

When used, it will look something like this:

 stream.from()... |window() .period(10s) .every(10s) |log() |count('value') 
0
source

I can dump the data from the script checkmark into a separate database ...

 stream |from() .database('telegraf') .measurement('cpu') .groupBy(*) .where(lambda: "cpu" == 'cpu-total') |eval( lambda: 100.0 - "usage_idle" ) .as('usage_util') .keep() .quiet() |InfluxDBOut() .create() .database('debugging') 

Then I use Chronograf explorer to view the results ...

0
source

Source: https://habr.com/ru/post/1011769/


All Articles