mblackstock / node-red-contrib-influxdb

Node-RED nodes to save and query data from an influxdb time series database
Other
64 stars 44 forks source link

Documentation Request: How to specify predefined timestamps #110

Closed visualcurrent closed 8 months ago

visualcurrent commented 2 years ago

TL;DR Please tell us how to include our event time (as opposed to server ingestion time) in each Output Node Usage Notes for each payload style.

InfluxDB clearly defines in their Line Protocol that this will enter data with the timestamp we provide

measurement<comma>tagset<space>fieldset<space>timestamp

It also tells us that the timestamp is optional. Leaving it out will record the server based ingestion timestamp.

measurement<comma>tagset<space>fieldset

The usage notes here don't provide clear documentation for how to override the ingestion time with our own event time.

Just like InfuxDB clearly documents their example with a timestamp and then add that it can be optionally removed to use server time, it would be really great if every Output Node example here would follow this useful convention.

Please show or describe how predefined timestamps are included in the various payload styles.

TheNON75 commented 2 years ago

Hi there,

i hope the code is still maintained. I have an issue with the timestamp as well and any help is welcome. In case using time: new Date() (as it is shown in the batch example), according to the influx api spec, it is ignored. However, when using timestamp: new Date() or timestamp: Date.now() results in nothing useful.

May someone point me to the right direction how to use own/predefined/custom/static/whatever timestamp?

thanks regards

mblackstock commented 2 years ago

Thanks for your feedback on the documentation. Apologies if it is not clear. I'd be happy to review a pull request if you would like to improve it.

If there is a bug, that is, the time or timestamp properties are not working as you'd expect, please open another issue and I will have a look. Again, a pull request for any fixes are welcome.

To specify the time using the output node, you use the time reserved property in any of the payload formats as shown in the last example.

Unlike the output node, the batch node uses a timestamp property that is at the same level as the measurement, tags and fields properties.

TheNON75 commented 2 years ago

thank you, i've created a new issue and make a pr afterwards if necessary

112