From bc884175bed578aec8f56d0ab478055072d5af4e Mon Sep 17 00:00:00 2001 From: sunyu <54071226+sunyu129@users.noreply.github.com> Date: Wed, 16 Sep 2020 20:33:00 +0800 Subject: [PATCH] Configure collector push address (#296) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * "配置化collector推送地址" * "配置化collector推送地址" Co-authored-by: 孙宇 --- src/toolkits/stats/init.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/toolkits/stats/init.go b/src/toolkits/stats/init.go index 29f674d1..8c26f26f 100644 --- a/src/toolkits/stats/init.go +++ b/src/toolkits/stats/init.go @@ -27,8 +27,8 @@ func Init(prefix string, addr ...string) { } else if file.IsExist(path.Join(runner.Cwd, "etc", "address.yml")) { //address.yml 存在,则使用配置文件的地址 - port := address.GetHTTPPort("collector") - PushUrl = fmt.Sprintf("http://127.0.0.1:%d/api/collector/push", port) + newAddr := address.GetHTTPAddresses("collector") + PushUrl = fmt.Sprintf("http://%s/api/collector/push", newAddr[0]) } Counter = NewCounter(prefix)