grafana / influxdb-flux-datasource

Grafana datasource plugin for Flux (InfluxDB)
Apache License 2.0
51 stars 21 forks source link

Flux plugin not working with Influx 1.8 #82

Closed jlsam closed 4 years ago

jlsam commented 4 years ago

I've been trying to get Flux to connect in Grafana. I had Grafana v6.7.2, InfluxDB 1.7.10 and grafana-influxdb-flux-datasource v5.4.1.

I couldn't get it to work, even with 'telegraf/autogen' as Default bucket, as suggested in https://community.influxdata.com/t/influxdb-error-internal-server-error-with-flux-data-source-on-grafana/11210 I was getting the error

Data source connected, but has no data. Verify the “bucket” field and make sure the bucket has data.

I tried other existing (Ithink) buckets, but nothing worked. In the meantime, I could successfully run in CLI influx -type=flux -username -password -execute 'from(bucket:"telegraf") |> range(start:-5m) |> filter(fn:(r) => r._measurement == "cpu")'

Then I thought, maybe there is a fix, let me update the packages. And now I'm running InfluxDB 1.8.0 and the same Flux command now returns

Error: 404 page not found : 404 Not Found

What would be the simplest command to check connectivity? buckets()? influx -type=flux -username -password -execute 'buckets()'

I think Flux is still enabled in my system after the update. I chose to keep the existing .conf. $ cat /etc/influxdb/influxdb.conf | grep flux-enabled flux-enabled = true and influx -type=flux -username <user> -password <pass> works.

gelldur commented 4 years ago

I'm using Influx 1.8 + Grafana 6.7.2 seems to work here. image

jlsam commented 4 years ago

With that setting, it says 'Testing...' for a long time, but then it says OK.

But then it's too slow and unusable in Grafana. I'm using Firefox. The default expression

from(bucket: "telegraf")
  |> range($range)
  |> limit(n:1000)

returns too many results that take too long, the browser becomes super slow, unusable, crashes tabs... and sometimes doesn't return anything. While this happens, telegraf CPU usage shoots up for a long time early on and then the browser stops working properly.

If I reduce the limit to say 10, sometimes nothing happens. Other times, I get results, but takes too long and still hangs the browser. I'm still testing, but at least now I see it working. Thanks.