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)