Network undefined when adding data source to grafana

i am trying to add a influxDB as data source in Grafana and facing the attached

error.
please help in resolving it.

Is there a reason you have chosen Browser access, Server would be more usual. With Browser and a specification of localhost I think you will only be able to run the browser on the machine running influx.
What do you see if you run, in a terminal, the command
influx

the program ‘influx’ is currently not installed.

i have not hosted Grafana, i am using the free hosting that is why used browser.
should i use server in this case as well?

Sorry I don’t understand the question. Influx must be running somewhere in order to access the database. Where is it running, and where is Grafana server running?

when i run influxd it shows that the server is running.
but when i do run influx it tells me to install influxdb-client package, i have got that installed now so it works now and gives me the influxql cli to fire queries.

but when i try to add a data-source it shows error “network undefined” when done with browser access and “bad gateway(502)” when done with server access

You didn’t answer the questions, where is influx server running and where is grafana server running?

  • the influxd is running on localhost:8086
  • i haven’t hosted grafana on my machine i am using the free hosting that grafana provides.

Do you mean Grafana Cloud? Sorry, I don’t know about setting that up. Presumably there are some tutorials to follow.

yes Grafana cloud is what i am using.
thanks for the effort :slight_smile:

it’s happening because incoming requests are not allowed on my machine.
and due to this Grafana cannot interact with the influxDB that i have locally installed in my machine.

To be able to connect to an InfluxDB instance (running on your local machine) using hosted Grafana Cloud instance and browser access mode you’ll need to configure CORS to be able to communicate with InfluxDB. CORS is something browsers enforced when doing request between different domains. I don’t think InfluxDB allow you to configure this so you’ll need to put a proxy server like nginx which proxy requests to your InfluxDB instance.

A really ugly/temporary way of solving this may be to use a browser extension, like this one for example: https://chrome.google.com/webstore/detail/allow-control-allow-origi/nlfbmbojpeacfghkpbjhddihlkkiljbi