Data doesnt get visualized when i send custom timestamp along


Currently i am sending sensor signals via mqtt to influxdb every 10ms in line protocol format. When i dont add a custom timestamp, everything works and the data gets visualized perfectly, but the time is not right. Thats why i wanted to insert my own timestamp. I calculate the timestamp in Unix format with nanosecond precision, here an example from the payload:

‘Velocity,location=us-midwest value=4244.0 1680258982966000000’

I have no clue what the problem could be or how to solve it, thankful for every help i receive

What i tried so far:

I added an output plugin to my telegraf config to see, how the data gets translated for influxdb, and it seems to be no payload formatting problem. I compared the telegraf translation with and without the timestamp and both formatting&length were the same.
So from this information, i assumed the problem was between influxdb and telegraf, because somehow influxdb does not like the data i am giving it.

I then installed InfluxCli and tried to write data with the Cli. At first i tried my own payload, but as usual no data got shown. then i tried the example data from “influx write | InfluxDB OSS 2.6 Documentation”:

m,host=host1 field1=1.2,field2=5i 1640995200000000000

BUT this data didnt get received either. Although when i removed the timestamp from the message, the data got accepted and shown in the data explorer

If anyone got any suggestions what i could be doing wrong or what else i might try, dont hesitate.

Update: I figured out, that my data didnt get shown, because i didnt consider the timezone-diff. After considering that, my values can now be visualized.

But my timestamp is still not correct yet, the timestamps i send are not the ones shown in influxdb. anyone any suggestions what the cause could be?

Another Update: I finally got 1 message to work, but i did that with Influx CLI.

The message that works: Velocity,location=Nowwhere1 value=70.0 1680693119882000000

I tried my own payload once again, which looks like this: Velocity,location=Nowwhere1 value=38.0 1680694228035000000, but the timestamps in my own messages dont get recognized.

Any ideas?

Finally figured it out, the string i send to influxDB was too big (256byte), but when i made it shorter to 201byte, the timestamp updated just fine and now everything works.

In conclusion: I forgot to adjust my timestamp depending on the timezone and the message i send was too big

thy all for listening :))

Thank you for sharing your solution!!

1 Like