Remove hardcoded url schema
This commit is contained in:
parent
e46da5a181
commit
94a1601ab2
@ -18,11 +18,15 @@ const (
|
|||||||
func NewElasticSearchTransport(connectionString string) (TracerTransport, error) {
|
func NewElasticSearchTransport(connectionString string) (TracerTransport, error) {
|
||||||
conUrl, err := url.Parse(connectionString)
|
conUrl, err := url.Parse(connectionString)
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
username := conUrl.User.Username()
|
username := conUrl.User.Username()
|
||||||
password, _ := conUrl.User.Password()
|
password, _ := conUrl.User.Password()
|
||||||
cfg := elasticsearch.Config{
|
cfg := elasticsearch.Config{
|
||||||
Addresses: []string{
|
Addresses: []string{
|
||||||
"https://" + conUrl.Host,
|
conUrl.Scheme + conUrl.Host,
|
||||||
},
|
},
|
||||||
Username: username,
|
Username: username,
|
||||||
Password: password,
|
Password: password,
|
||||||
|
Loading…
Reference in New Issue
Block a user