Hi,
I am super new to influx DB.
I am collecting Collectd data from multiple servers via Telegraf and store it into an influxDB bucket named “collectd”.
I managed to create a pretty Grafana dashboard tile by querying said bucket in the Flux language with these queries displaying a mirrored graph like collectd does:
// rx query "down"
from(bucket: "collectd")
|> range(start: 2021-03-18T13:16:26Z, stop: 2021-03-18T13:31:26Z)
|> filter(fn: (r) => r["host"] == "Unit24")
|> filter(fn: (r) => r["_measurement"] == "interface_rx")
|> filter(fn: (r) => r["instance"] == "tun0")
|> filter(fn: (r) => r["type"] == "if_octets")
|> derivative(unit: 1s, nonNegative: false)
|> map(fn: (r) => ({ r with _value: r._value * -1.0 }))
|> yield(name: "In")
// tx query "up"
from(bucket: "collectd")
|> range(start: 2021-03-18T13:16:26Z, stop: 2021-03-18T13:31:26Z)
|> filter(fn: (r) => r["host"] == "Unit24")
|> filter(fn: (r) => r["_measurement"] == "interface_tx")
|> filter(fn: (r) => r["instance"] == "tun0")
|> filter(fn: (r) => r["type"] == "if_octets")
|> derivative(unit: 1s, nonNegative: false)
|> yield(name: "Out")
I was hoping the legend would read
- In
- Out
but instead it reads
- interface_rx value {host=“Unit24”, instance=“tun0”, type=“if_octets”}
- interface_tx value {host=“Unit24”, instance=“tun0”, type=“if_octets”}
which is accurate but unintuitive.
So how can I change what the legend says?!
I have not found any clues on that.
Also:
Are there ANY Flux language Grafana Dashboards to download and learn from?
All I can find on Dashboards | Grafana Labs seem to use influxQL, which is apparently not compatible with influxDB 2.0
Thanks for any hints!
Holger