Hello
I need to get the network interface bandwidth, but my flux code gives strange spikes on the graphs in grafana
I can’t figure out what’s going on.
If anyone has encountered this, please help me)
My flux
from(bucket: “my_bucket”)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r[“hostname”] == “${host}”)
|> filter(fn: (r) => r[“intname”] == “${interface}”)
|> filter(fn: (r) => r[“_field”] == “ifout”)
|> filter(fn: (r) => r[“host”] == “monitoring”)
|> derivative(unit: 1s, nonNegative: false)
|> map(fn: (r) => ({ r with _value: r._value * 8.0}))
|> aggregateWindow(every: 5m, fn: last, createEmpty: false)