I’m using InfluxDB2 on an Ubuntu system to monitor it, stuff like CPU, Mem usage, network stuff, etc. (all collected via the System telegraf plugin). Currently I’m trying to add a cell to my board that shows total outbound traffic in the past hour, but the data makes no sense. This is the code for the query:
import "math"
from(bucket: v.bucket)
|> range(start: v.timeRangeStart)
|> filter(fn: (r) => r._measurement == "net")
|> filter(fn: (r) => r._field == "bytes_sent")
|> filter(fn: (r) => r["host"] == "engager")
|> filter(fn: (r) => r["interface"] == "eno2")
|> sum()
|> map(fn: (r) => ({
r with
_value: r._value / 1073741824
})
)
It should return a single value for the total gigabytes sent (hence the division), and when I use 1h for the time window, I get values like 570,000 GB, which is crazy, especially considering the network graph in the same timeframe looks like this:
Is there something I’m missing in my query, or did I mess it up somehow? Because there’s no way this value is correct.