InfluxDB v2 input plugin?

I’m confused about whether this exists or not. I’m talking about an input plugin that will read metrics from a bucket, not the generic InfluxDB process metrics.

My use case is the following.
I have an instance of InfluxDB OSS (2.0.9). A couple of services are writing data using official SDKs. These clients are mostly writing every second.
I need to read from this instance and write to InfluxDB Cloud at a slower interval, say 10s. I don’t need to downsample or do any aggregations. I just need to take a snapshot of the last value written for each series every 10s.

Is this possible to achieve with Telegraf?

In your case, I would probably write a script to grab the latest value, and then use the exec input plugin and ensure the interval is set to 10 seconds.

We do not currently have an influxdb_v2 input plugin.

What I have seen used to relay to InfluxDB is the influxdb_v2 listener input. In this case users would push to the listener and it would relay to InfluxDB. However, that doesn’t sound like a fit in your case.

1 Like

By using influxdb_v2 listener input plugin could I then have 2 different influxdb_v2 output plugins? One pointed at the OSS instance and writing every second and another one pointed at the cloud instance writing every 10s?. Looking at the documentation of the influxdb_v2 output plugin I guess this is not possible as the interval is set in the main telegraf config and can’t be specified for each output plugin.

So… what if the services writes both to the OSS InfluxDB and to the Telegraf (with influxdb_v2 listener input and influxdb_v2 output plugin pointed to the InfluxDB Cloud).
This way all data would be written to the OSS InfluxDB and Telegraf would take care to only write to the InfluxDB Cloud every 10s, right?
We could even throw in the aggregators.basicstats Telegraf plugin to get the mean value of each series in 10s intervals and write that to InfluxDB Cloud…

I’m going to try this.

I guess my question is…

Can I write to this influxdb_v2 listener with standard InfluxDB 2 SDKs? Simply pointing to the telegraf input plugin (i.e. http://localhost:8087)? What about authentication? How do I create tokens and such?

Looking at the documentation of the influxdb_v2 output plugin I guess this is not possible as the interval is set in the main telegraf config and can’t be specified for each output plugin.

Correct, Telegraf outputs all get written at the same time from the buffer. There is no logic to tell what metrics were written to one output versus another.

So… what if the services writes both to the OSS InfluxDB and to the Telegraf (with influxdb_v2 listener input and influxdb_v2 output plugin pointed to the InfluxDB Cloud).
This way all data would be written to the OSS InfluxDB and Telegraf would take care to only write to the InfluxDB Cloud every 10s, right?

Yeah, this is how I would approach this.

Can I write to this influxdb_v2 listener with standard InfluxDB 2 SDKs? Simply pointing to the telegraf input plugin (i.e. http://localhost:8087)? What about authentication? How do I create tokens and such?

SDKs should work.

The influxdb_v2 README has config options for either a token that you make up or using cert based authentication.

Good luck!

1 Like