prometheus-community / elasticsearch_exporter

Elasticsearch stats exporter for Prometheus
Apache License 2.0
1.91k stars 792 forks source link

Version 1.1.0rc1 does not allow es.snapshots command line argument #233

Closed oloo closed 5 years ago

oloo commented 5 years ago

Looks like version 1.1.0rc1 does not accept the --es.snapshots=true option.

I tried running this against an elasticsearch cluster running elasticsearch version 6.1.4 which should work.

Passing the snapshot flag gives

docker run -it -p 9108:9108 -p 9114:9114 justwatch/elasticsearch_exporter:1.1.0rc1 --es.uri=http://elasticsearch:9200 --es.snapshots=true --es.all=true --es.indices=true
elasticsearch_exporter: error: unexpected true, try --help

Not passing it starts the server as expected but fails when I try to curl it. From the same machine

level=info ts=2019-03-07T03:53:09.620364389Z caller=clusterinfo.go:197 msg="triggering initial cluster info call"
level=info ts=2019-03-07T03:53:09.620875692Z caller=clusterinfo.go:166 msg="providing consumers with updated cluster info label"
level=info ts=2019-03-07T03:53:10.84473098Z caller=main.go:148 msg="started cluster info retriever" interval=5m0s
level=info ts=2019-03-07T03:53:10.845089945Z caller=main.go:183 msg="starting elasticsearch_exporter" addr=:9114

The curl response

curl http://localhost:9108/metrics
curl: (52) Empty reply from server
zwopir commented 5 years ago

Hi @oloo,

thanks for reporting this.

The commandline to include the snapshot metrics must be --es.snapshots (without the =true). I'll document this in the README.

Regarding the empty response: the port in the must be 9114 (a breaking change, as pointed out in the release notes - sorry for the confusion)