elastic / elasticsearch-metrics-reporter-java

Metrics reporter, which reports to elasticsearch
Apache License 2.0
230 stars 103 forks source link

http connection string hardcoded #45

Open jorgjanke opened 7 years ago

jorgjanke commented 7 years ago

In ElasticsearchReporter.openConnection(..) the protocol is hardcoded

URL templateUrl = new URL("http://" + host  + uri);

(line 439) - just noticed also reported by #17

Please add the ability to modify the protocol in the builder or add logic like

String theHost = host;
if (!host.contains("://") {
  theHost = "http://" + host;
}
URL templateUrl = new URL(theHost  + uri);