Telegraf -> Kapacitor -> InfluxDB possible?


Jan 19

Hi everbody,

  1. Is it possible to configure telegraf sending its data to kapacitor, instead of influxdb directly? I searched in the documentation, but nothing is mentioned there. Are there any disadvantages with that approach? I think it could be useful to add new tags or somekind like later on at a central position.

  2. Does Kapacitor have the on-disk snapshot functionality for fault tolerance?

Don’t hesitate writing your own thoughts about that topic :wink:


  1. It is possible! Kapacitor has a mirror of the InfluxDB API for writes (hostname:8086/write) .
    In the [[outputs.influxdb]] section of your telegraf.conf set urls = ['http://kapacitor-host:8086']

  2. Kapacitor does not persist any writes/snapshots to disk. Meaning if Kapacitor crashes or even during a restart you will loose a small amount of data. If you cannot tolerate gaps in your data I would recommend writing the raw data directly into a database with a short retention policy. Then via the subscription system have Kapacitor write the processed data back to InfluxDB for a different database with a longer retention policy. That way if Kapacitor crashes or needs to be restarted you can replay the data from the raw database so long as it is within the duration of the short retention policy. Also note that you should configure Kapacitor’s subscriptions to exclude the database Kapacitor is writing to or you are going to duplicate work since Kapacitor will subscribe to that data too. This way you are essentially using InfluxDB as the on-disk snapshot of the data for Kapacitor.

In addition to what jackzampolin said, another item of note is that that kapacitor does not handle out-of-order points very well. And if you’re collecting data from multiple hosts, you will have out-of-order points, as telegraf buffers them, as well as things like clock offset, network latency, etc.
If you’re just taking the data in, and emitting it straight to influxdb with minimal to no processing, this might not be an issue. And some of the more simple kapacitor nodes might not choke, but many of them will. There is some discussion on the subject over at: Simple TICKscript that will always error · Issue #1217 · influxdata/kapacitor · GitHub

1 Like