Data forms:

Data from Telegraf

from(bucket: "acbalingit")
  |> range(start: v.timeRangeStart, stop:v.timeRangeStop)
  |> filter(fn: (r) =>
    r._measurement == "cpu" and
    r.host == "acbalingit-do" and
    r.cpu == "cpu-total" and (
      r._field == "usage_user" or
      r._field == "usage_system" or 
      r._field == "usage_iowait" or 
      r._field == "usage_irq"
    )
  )
  |> movingAverage(n: 5)

Data from Prometheus scraped by Telegraf

from(bucket: "cxteam")
  |> range(start: v.timeRangeStart, stop:v.timeRangeStop)
  |> filter(fn: (r) =>
    r._measurement == "espeasy_device_BMP280" and
    r.valueName == "Temperature" and 
    r._field == "gauge
  )

Data from Collectd forwarded to Telegraf

TODO: columns not summed correctly; only shows up plots in Grafana Explore tab.

from(bucket: "acbalingit")
  |> range(start: v.timeRangeStart, stop:v.timeRangeStop)
  |> filter(fn: (r) =>
    r._measurement == "cld_cpu_value" and 
    r._field == "value" and (
      r.type_instance == "user" or 
      r.type_instance == "system" or 
      r.type_instance == "interrupt"
    )
  )
  |> aggregateWindow(every: v.windowPeriod, fn: mean)
  |> fill(usePrevious: true)
from(bucket: "cxteam")
  |> range(start: v.timeRangeStart, stop:v.timeRangeStop)
  |> filter(fn: (r) =>
    r._measurement == "net" and 
    r.interface == "enp0s25" and (
      r._field == "bytes_recv" or
      r._field == "bytes_sent"
    )
  )
  |> aggregateWindow(
    every: v.windowPeriod,
    createEmpty: false,
    fn: last
  )
  |> derivative(
    unit: 1s,
    nonNegative: true,
  )
  |> movingAverage(n: 3)