Setup: infludb v2.7.0, grafana v8.2.5
I have stored time series data (fitness data) in a bucket “test” and I have two tags “start” and “stop” representing the time within the series was recorded (both in format: “2023-05-21T14:00:55.000Z”). This span I want to use in grafana for the timerange of representing the data in the _field values.
Approach is as follows:
a = from(bucket: "test")
|> range(start: -1y, stop: now())
|> filter(fn: (r) => r._measurement == "series" and r.id == "175")
|> keep(columns: ["start"])
|> distinct()
b = from(bucket: "test")
|> range(start: -1y, stop: now())
|> filter(fn: (r) => r._measurement == "series" and r.id == "175")
|> keep(columns: ["stop"])
|> distinct()
from(bucket: "test")
|> range(start: a, stop: b)
|> filter(fn: (r) => r._measurement == "series" and r.id == "175" and r._field == "frequency")
|> aggregateWindow(every: 1m, fn: mean, createEmpty: false)
Problem: I cant “extract” the times as string or time, they still are in a table.
Error:
value is not a time, got stream
I have tried also a._start, b._stop with same result:
...
|> range(start: time(v: a._start), stop: time(v: b._stop))
...
I couldn’t find a way to dismantle the table into single values - any hint appreciated.