I am new to grafana and Elasticsearch.
Please, I am having an issue using elasticsearch as a datasource. When I configure the datasource and hit the save & test button I get a 502 error back.
thers is a Chrome plugin named ElasticSearch-head which can test if you can access your es, you can type in your es URL to check if the âhttp://localhost:9200â connection works well.
Not sure if you have Grafana running on the same computer where you do the call to http://localhost:9200. Otherwise please do a curl/wget request to http://localhost:9200 from the Grafana instance. Alternatively open chrome developer tools and check the console and network tab (failing request) and include details here.
My elasticsearch is running on a virtual machine and my grafana is on my localhost. I am getting the Bad GateWay Error when trying to add elasticsearch as a datasource in grafana. as url I use http://[virtual-machine-ip]:9200)
does anyone know how to solve this?
In my environment, the solution I used was to specify the IP address of the Elasticsearch host in the URL instead of the hostname. To determine that, I logged into the grafana pod (âk exec -n prometheus --stdin --tty prometheus-grafana-xxxx-xxxx â /bin/shâ) and tried to ping âelasticsearchâ and âelasticsearch-masterâ, and both failed. So I got the IP address from âk get services -A|grep elasticsearchâ.