I am wondering if during tickscript development, there is any opportunity to dump the stream state after passing through the processing node (log to the file, stdout)?
I found it useful putting |httpOut('id')
for debugging purposes. Later you can access http://kapacitor-host:9092/kapacitor/v1/tasks/<task_id>/<httpOut_id>
and see what data is passing through that node.
Kapacitor has a Log Node that allows you to dump the stream state to the Kapacitor log files.
In use, it would look something like the following:
stream.from()...
|window()
.period(10s)
.every(10s)
|log()
|count('value')
Running kapacitor show TASK_NAME
command should show you some information about the task itself but under the DOT:
section there's a graph description which contains stats about how many data points reached which node.
Another way of debugging would be using InfluxDBOutNode
to store the points and see what's being processed. Hope this helps.
I am able to dump data from within a tick script 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...
© 2022 - 2024 — McMap. All rights reserved.