13

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)?

  • Can you explain what you're looking for a bit more. I'm not sure I totally follow what you're asking – Michael Desa Nov 03 '16 at 17:50
  • 1
    There is a log node, but I prefer to write the data back to InfluxDb. We have a separate influx db just for this purpose with a 1 day retention policy so that data doesn't build up. – Mike Two Nov 10 '16 at 17:39
  • You can pull Kapacitor [stats via REST API](https://docs.influxdata.com/kapacitor/v1.1/api/api/#tasks) and load them into InfluxDB. I wonder if InfluxData will release a Telegraf plugin for this - seems like a natural progression. – rbinnun Jan 10 '17 at 14:29

4 Answers4

6

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.

tmszdmsk
  • 71
  • 1
  • 5
3

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')
Michael Desa
  • 4,607
  • 24
  • 19
2

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.

suda
  • 2,604
  • 1
  • 27
  • 38
2

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...

ericslaw
  • 851
  • 1
  • 8
  • 16