Local Prometheus data source issue: Unknown error during query transaction. Please check JS console logs

Hello, I am currently trying to setup a dashboard that collects data from Prometheus. The data source is local ( http://localip:9090) and works when setting up a local ip grafana dashboard (http://localip:3000). I would like to be able to see the dashboard on my regular online account, so that in order to see the metrics I wouldn’t have to be necessarily connected to the same local network. When I try to add the local prometheus datasources and “save and test” the request times out and I get the error “Unknown error during query transaction. Please check JS console logs.” Is there a way to link the local dashboards to my online account? I am quite new to this and hope that someone can help me out, thanks.

Hi @danarampini,

Let’s see if we can solve this. What you say this describes your situation:

  • you have prometheus running “locally”
  • What does this mean? Like you’re running it on a machine at home, on a local network?
  • and you want to integrate this “local” prometheus to your Hosted Grafana Cloud instance?

Is that accurate?

Hi @mattabrams , I am also getting the same error when I try to add Prometheus as a data source. My prometheus server is up and running on localhost:9090 without any issues. FYI I am using grafana cloud.

Is localhost or localip as your first called it a machine that is accessible over the internet? Are you running Prometheus on a server? Can you remotely retrieve data from one of your prometheus metric’s endpoints using an HTTP client like cURL, or even a web browser?

Thanks for your response @mattabrams !
I do not clearly understand your first question, but I assume that you wanted to know if my localhost is accessible over the internet - my answer is yes!
I installed Prometheus locally on my machine and started an instance by providing a yml file and running this command prometheus --config.file=<myconfig.yml>
I am able to retrieve data from all of the metric endpoints on my web browser as HTTP calls. Am I missing something while trying to add prometheus as a data source ?

Apologies, @ashchakravarthy. So, as a Grafana Cloud user, have you explored Grafana Agent?

Are you trying to accomplish something like this?

@mattabrams , Thank you for your suggestions. At the moment I was able to add the data source by instally grafana locally rather than the cloud version.
I will consider your options if I need to use the cloud setup in future. Thanks!

1 Like

Hello @mattabrams, sorry for the late reply I ended up not needed the cloud version. And yes the ‘local’ means that I was running it on a local network. Thank you!

1 Like