Commit 37caf87d authored by Brad Davidson's avatar Brad Davidson Committed by Brad Davidson

Add exposed metrics listener instead of replacing loopback listener

parent a8a6edfb
...@@ -523,10 +523,11 @@ func (e *ETCD) clientURL() string { ...@@ -523,10 +523,11 @@ func (e *ETCD) clientURL() string {
// metricsURL returns the metrics access address // metricsURL returns the metrics access address
func (e *ETCD) metricsURL(expose bool) string { func (e *ETCD) metricsURL(expose bool) string {
address := "http://127.0.0.1:2381"
if expose { if expose {
return fmt.Sprintf("http://%s:2381", e.address) address = fmt.Sprintf("http://%s:2381,%s", e.address, address)
} }
return "http://127.0.0.1:2381" return address
} }
// cluster returns ETCDConfig for a cluster // cluster returns ETCDConfig for a cluster
...@@ -535,7 +536,7 @@ func (e *ETCD) cluster(ctx context.Context, forceNew bool, options executor.Init ...@@ -535,7 +536,7 @@ func (e *ETCD) cluster(ctx context.Context, forceNew bool, options executor.Init
Name: e.name, Name: e.name,
InitialOptions: options, InitialOptions: options,
ForceNewCluster: forceNew, ForceNewCluster: forceNew,
ListenClientURLs: fmt.Sprintf(e.clientURL() + ",https://127.0.0.1:2379"), ListenClientURLs: e.clientURL() + ",https://127.0.0.1:2379",
ListenMetricsURLs: e.metricsURL(e.config.EtcdExposeMetrics), ListenMetricsURLs: e.metricsURL(e.config.EtcdExposeMetrics),
ListenPeerURLs: e.peerURL(), ListenPeerURLs: e.peerURL(),
AdvertiseClientURLs: e.clientURL(), AdvertiseClientURLs: e.clientURL(),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment