Search code examples
influxdbgrafana

Connecting grafana to influxdb


I'd like grafana to get data from influxdb. They're running on the same host. I've not had much joy here.

I've turned on authentication in influxdb. I've an admin account with password, and I can use those credentials to connect to influxdb on the commandline.

When I try to connect via grafana, I see I can choose "basic auth" or not. I'm not sure what credentials are requested at basic auth, but whether or not I check that box, I see the (not very helpful) error at the bottom.

enter image description here

My influxdb http config looks like this:

[http]
  # Determines whether HTTP endpoint is enabled.
  enabled = true

  # The bind address used by the HTTP service.
  bind-address = ":8086"

  # Determines whether HTTP authentication is enabled.
  # auth-enabled = false
  auth-enabled = true

I've also tried changing s/localhost/0.0.0.0/ in the grafana dialog just in case, but that doesn't change the outcome.

ubuntu@loire1:/tmp$ sudo netstat -tunapl | grep influx
tcp6       0      0 :::8086                 :::*                    LISTEN      10399/influxd   
tcp6       0      0 :::8088                 :::*                    LISTEN      10399/influxd   
udp        0      0 127.0.0.1:25826         0.0.0.0:*                           10399/influxd   
ubuntu@loire1:/tmp$ 

Any pointers?


Solution

  • The answer to this is that one should specify "proxy" rather than "direct" access.

    This seemed counter-intuitive to me, so let me explain what is meant here. It is (for some reason that escapes me) occasionally reasonable for the user's browser to fetch data directly from the data source. In this case, the access is direct.

    In the (only) scenario that makes sense to me, the browser accesses grafana, which in turn accesses the data source. So in this sense the data is being proxied (or reverse proxied, for those used to nginx) by grafana.