Closed carlosjgp closed 6 years ago
Hi Carlos,
thanks for bringing this up and thanks for the helpful gist. I need to have a closer look at it. Until now we tried to avoid explicitly setting an ES version. If possible we'd like to stick with an version agnostic elasticsearch_exporter. To avoid creating an unnecessaryPR, we should finish this discussion about setting an ES version first.
As far as I know, ES supports POST and GET requests for some queries. So maybe a possible solution is to add a method flag. I need to evaluate this. If it is the way to go, I'll happily help you with creating the code/PR.
I've just looked into this, and the errors above are purely SSL verification errors - I tested the project with ES version 6 and it still works perfectly :+1:
Hi @carlosjgp, I've just merged a es.ssl-skip-verify fix PR. Can you try the latest master again with -es.ssl-skip-verify flag set?!
closing this issue as I think it's resolved. Feel free to re-open if the problem isn't solved for you, @carlosjgp
I am still facing this issue. Getting 401 error,
bash-4.1$./elasticsearch_exporter -es.all=true -es.indices=true -es.shards=true -es.ssl-skip-verify -es.uri="http://localhost:9200" level=info ts=2018-07-03T08:14:46.113926062Z caller=main.go:81 msg="starting elasticsearch_exporter" addr=:9108 level=warn ts=2018-07-03T08:14:54.129103043Z caller=nodes.go:1383 msg="failed to fetch and decode node stats" err="HTTP Request failed with code 401" level=warn ts=2018-07-03T08:14:54.129136234Z caller=indices.go:458 msg="failed to fetch and decode index stats" err="HTTP Request failed with code 401"
due to which I am not able to get all the metrics supported by the elasticsearch exporter.
Hi sammit20,
using -es.ssl-skip-verify
with a non-https es.uri
doesn't make sense. So your either getting the 401 because TLS is required (thus using a https es.uri
) or basic auth is required. In the latter case you can specify the credentials like so -es.uri=http://username:password@localhost:9200
Thanks zwopir for the quick response. However my cluster doesn't have any authentication specified. Its a test one for checking the elasticsearch exporter metrics. I can easily access the apis like http://localhost:9200, http://localhost:9200//_nodes/stats,http:/localhost:9200/_nodes/stats, http://localhost:9200/_all/_stats without any authentication. So in that case what value I need to pass in the ES.URI parameter to get the nodes and indices metrics?
Hi sammit20,
I tried to reproduce your issue with the latest ES docker image. Started the image as described in https://www.elastic.co/guide/en/elasticsearch/reference/6.3/docker.html and then the exporter with
./elasticsearch_exporter -es.all=true -es.indices=true -es.shards=true
I was not able to reproduce your issue. The es.uri
Parameter defaults to http://localhost:9200
, so you don't need to specify it, if you are running the exporter on one of the ES cluster nodes
Thanks Zwopir for checking on that. Can you check the same from Binary as well? As I've downloaded the binary"elasticsearch_exporter_1.0.3rc1.linux_amd64-v1.0.3rc1" and executing with that.
I did check it with the binary. The ES (not the elasticsearch_exporter) was running in the container
Thanks zwopir for your help. The issue was with my cookie which was not letting me to access metrics page. Is there any way to include the cookie while executing the exporter?
I have built a Docker image using the most recent commit (6101e75) and run it like this
where
https://localhost:2006
is an ssh tunnel to an instance in my AWS VPC that can access my AWS ES instancewhen I request the Prometheus metrics I have this logs on the exporter
I did send the http requests manually and this is the output https://gist.github.com/carlosjgp/6e6a6d74eda703b93e9067734ff4618c
I can try to create a PR to add a parameter to configure the ES version... maybe is not that easy. I would like to start doing some GoLang coding, so I'm quite keen to try it