Flux not working with InfluxDB 1.8

Yes, that works:

influx -type=flux -path-prefix /api/v2/query -username <user> -password <pass> -execute 'from(bucket:"telegraf")
    |> range(start:-5m)
    |> filter(fn:(r) => r._measurement == "cpu")'

But oddly, it doesn’t with a much simpler command that doesn’t take any arguments:

influx -type=flux -path-prefix /api/v2/query -username <user> -password <pass> -execute 'buckets()'

Am I doing something wrong?

But in any case, I don’t see how this fix helps me with Grafana. I can’t add ‘-path-prefix /api/v2/query’ to the service file (it doesn’t work, and I also want to access the data the regular way). And I don’t see a way to add it in Grafana’s interface. Or do I need to monkey-patch Grafana’s Flux plugin?

Thanks!

2 Likes