Help clarifying this would be appreciated. I’m running this inside of the Chronograf UI.
Background
———————-
I have a Linux machine running Telegraf. Every 30 seconds, data is sent to InfluxDB. One of the inputs configured for Telegraf is ‘disk’. The Linux machine reports multiple devices and it would look something like this.
time (secs) machine_id device used_percent
———————————————————————————————
t1 m1 rootfs 10
t1 m1 tmpfs 2
t1 m1 devfs 20
t2 m1 rootfs 11
t2 m1 tmpfs 1
t2 m1 devfs 14
Running the following query, I expected to get all rows in the example table above. Note, t0 is <= to all example times in the table.
SELECT “used_percent”,”machine_id”,”device” FROM “mydb”.”my policy”.”disk" WHERE time >= t0s order by time
Actual Results:
time(secs) machine_id device used_percent
———————————————————————————————
t1 m1 tmpfs 2
t2 m1 tmpfs 1
It appears that multiple devices stored with the exact same time are not all returned. It may be returning the first one stored. I would like all the rows.
Discovery #1
————————
if I add a group by device, all rows are returned:
SELECT “used_percent”,”machine_id”,”device” FROM “mydb”.”my policy”.”disk" WHERE time >= t0s order by time group by “device”
Discovery #2
————————
if I add a where clause with two devices, only one is returned:
SELECT “used_percent”,”machine_id”,”device” FROM “mydb”.”my policy”.”disk" WHERE time >= t0s and (“device”=‘rootfs’ or “device”=“tmpfs”) order by time
time(secs) machine_id device used_percent
———————————————————————————————
m1-t1 m1 tmpfs 2
m1-t2 m1 tmpfs 1
Discovery #3
————————
if I add a where clause and request one of the devices not returned by default, the requested data is returned:
SELECT “used_percent”,”machine_id”,”device” FROM “mydb”.”my policy”.”disk" WHERE time >= t0s and “device”=‘rootfs’ order by time
time (secs) machine_id device used_percent
———————————————————————————————
t1 m1 rootfs 10
t2 m1 rootfs 11
Am I missing something with regard to selecting all data? I could see this causing unexpected problems if there are multiple machines that report the same data at exactly the same time, e.g. using the ‘memory’ stat:
time (secs) machine_id used_percent
———————————————————————————————
t1 m1 10
t1 m2 20
t1 m3 22
t2 m1 21
t2 m2 25
t2 m3 18
SELECT “used_percent”,”machine_id” FROM “mydb”.”my policy”.”memory” WHERE time >= t0s order by time
My guess is that only one row per time period would be returned unless I added a group by machine_id.
Thanks.