jgraichen / telegraf-ruby

Send events from Ruby to a Telegraf agent
GNU Lesser General Public License v3.0
13 stars 7 forks source link

Influxdb 2.0? #16

Closed bszerdy closed 3 years ago

bszerdy commented 3 years ago

Should this gem work with influxdb 2.0? I can't find any information in the readme that addresses this question.

franzliedke commented 3 years ago

Judging by the README of the influxdb gem we're using, it likely does not work. The new client gem supports InfluxDB 2.0 and also 1.8+ - maybe it's time to release a new major that requires InfluxDB 1.8?

Then again, the only usage of code from the influxdb gem is this line: https://github.com/jgraichen/telegraf-ruby/blob/7803b4aa56cf8989efdeed30c92cebce537e4334/lib/telegraf/agent.rb#L40

That feels like it's easy to make this library compatible with either client (or even require both 🤔) - would you be interested in sending a PR?

franzliedke commented 3 years ago

or even require both

Both seem to have no further gem dependencies - with standalone gems like that, the risk of version conflicts seems pretty low, so requiring both would be my personal favorite. Choosing one or the other would then be a config option of our Agent class.

jgraichen commented 3 years ago

This gem does not write to InfluxDB 1.0 nor 2.0, it only sends data in the Influx line protocol format to a telegraf socket_listener. Telegraf does support InfluxDB 2.0. This gem does not even support HTTP.

This gem explicitly does not support direct submitting points to InfluxDB. We do not want to handle retries, queuing points, unreliable networks, server restarts etc. All of that can be better handled by a local telegraf agent.

I explicitly recommend this client only for sending data to a telegraf agent on the same host (usually localhost).

jgraichen commented 3 years ago

The influxdb gem really is only used for line protocol serialization.