Hi All,
I am in the process of converting flow data from a wetland monitoring site that I want to display in Grafana from an Infludb database. The data is received daily in the form of an excel sheet from the provider which I isolate and parse through a number of nodes. I believe I am almost there but am stumped at the final hurdle. The 'measurements' are coming through to Grafana but the data points are absent. The debug output from one of the measurements (there are 5) looks like this:
{"measurement":"site1dailyvol","fields":{"sp1dailyvol":25.18999863},"tags":{"location":"sp1"},"timestamp":1564293600000}, .................
Anyone have suggestions that would enable the data points to display?
Also the function code to set the variables looks like this:
var site1 = msg.payload[0].rank;
var dailyvol1 = parseFloat(msg.payload[0].value);
var timestamp1 = Date.parse(msg.payload[0].date);
And the msg.payload:
msg.payload =
[
{
measurement: "site1dailyvol",
fields: {
sp1dailyvol: dailyvol1
},
tags:{
location:"sp1"
},
timestamp: timestamp1
},
Thanks Colin. In the function node prior to the Influxdb Batch node I use the following to convert the date record to unix time:
var timestamp1 = Date.parse(msg.payload[0].date);
Yes I saw that, and it looks correct. I haven't used the batch node just the basic one, but I do remember at least one other post where the timestamps did not seem to be going in correctly using the batch node.
The link below does say they should be in nanoseconds, which I think agrees with the numbers I have. Try multiplying by 10^6 and see what happens. Something like var timestamp1 = Date.parse(msg.payload[0].date).getTime()*1000000
Given advice isn't a must. It's personal preference. The reason behind it: less code, less bugs.
However, common thumb rule is good enough: if existing code works, don't touch it
I don't understand why removing the "group by" would have fixed the problem, which appeared to be to do with the way the data was being added to influx, not to do with the grafana.