I’m a new user who just start to use influxDB cloud v2. And I have trouble with using the Data Explorer. I’m not sure whether it’s a bug or I’m not using it correctly.
Here is how I reproduce it:
create a bucket named
insert 1 point into that bucket by following commands:
curl --request POST “https://us-west-2-1.aws.cloud2.influxdata.com/api/v2/write?org=XXXX&bucket=test&precision=s” --header “Authorization: Token XXXX” --data-raw ‘my_measure height=100 1603749600’
I expect I insert 1 data point at unix time stamp 1603749600 at precision second. So that is 2020-10-26 and at 10pm UTC time (google any unix time converter to check it).
view the data in data explorer.
So here is the problem, when I view data in past 7 days, the point shows in the graph says 2020-10-26 and at 10:30pm UTC time (check my uploaded image)
Then I change the timerange to view data in past 30 days, the point shows in the graph says the point shows in the graph says 2020-10-26 and at 11:00pm UTC time
Could anyone helps me to figure out what’s the problem here?
Thanks a lot
@H_F - Very interesting result here! I’m able to reproduce what you are seeing.
I’m struggling to decide if I think this is a bug or not, but it is certainly very confusing. Because you are querying on just one point, this is sort of a special case. The Data Explorer is running a query that includes
aggregateWindow with a
mean function. Naturally the
mean is not impacting the result here, but the window size will change timestamps to the center of the window. The window size changes with 7 days and 30 days setting. If your point used a timestamp that isn’t on the UTC hour, this behavior would be even more obvious.
For my own dashboards, I display the dynamic variable
v.windowPeriod which is what is changing when you adjust the time range. This variable is what is fed into the
windowAggregate function. I do wish that these automatic variables were displayed by default and that the explorer indicated clearly that
mean is the default too.
I encourage you to add to this Issue ticket or create a new one: you can pretty much copy your message into the ticket. https://github.com/influxdata/influxdb/issues/18907
Let us know your thoughts.
If you switch to the
Script Editor view, you can see the Flux query that the explorer is running. For me, it is this
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["_measurement"] == "my_measure")
|> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)
|> yield(name: "mean")
Thanks for you reply. Another thing I observe is this doesn’t just happen when I insert and query only 1 point, it shows the same symptom when I insert and query multiple daily points.
I’ll open a new github issue to see anyone can help on this.
Yes of course - it will window aggregate and average even if there are multiple points.
Please link the ticket here after you’ve made it!
So i asked the issue there. So apparently it’s a by design things, since they use [open, close) boundaries. I need to manually remove the window function to make dashboard correct.