Telegraf output influxdb_v2 plugin is not compatible with Point.toLineProtocol() from node client

So I have a RabbitMQ queue with messages containing a single point in line protocol.
These points are generated by the Node.js client library by doing:

const point = new Point("some-measurement")
  .timestamp(1620838490826) // in milliseconds
  .floatField("value", 0.125)

Now, using the Telegraf amqp_consumer input plugin I’m able to process these messages.

Problem is, the influxdb_v2 output plugin does not like the line protocol generated by the client library (!?)

It says:

E! [outputs.influxdb_v2] Failed to write metric (will be dropped: 422 Unprocessable Entity): unprocessable entity: failure writing points to database: partial write: points beyond retention policy dropped=X

The target bucket does not have any retention policy set.

I’ve read somewhere that’s caused by the fact that the influxdb_v2 output plugin expects the line protocol to use nanoseconds? Is that the case?
If so, then why the client libraries do not write these in nanoseconds?

Is it really impossible for the Telegraf influxdb_v2 output plugin to understand a unix timestamp in seconds or milliseconds? Maybe with a configuration option?

The conversation continue in Point.toLineProtocol() should write in ns precision by default. · Issue #337 · influxdata/influxdb-client-js · GitHub

Hey sranka, thank you for the quick reply on both platforms.

Although I believe the fix in the client library is needed. I still think the Telegraf influxdb_v2 output plugin should have an option to specify the timestamp precision (just like the writeApi of the client libraries have).

It is a waste of bandwidth (and money for those using InfluxDB Cloud) to send data in NS precision when it’s not needed. A point in line protocol written with ‘ns’ precision is 9 characters bigger than its ‘s’ precision version. This difference over millions of points could make a big difference in “Data In” costs of InfluxDB Cloud.