Configure collector push address (#296)

* "配置化collector推送地址"

* "配置化collector推送地址"

Co-authored-by: 孙宇 <suny129@chinaunicom.cn>
master
sunyu 4 years ago committed by GitHub
parent fb6e789909
commit bc884175be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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)

Loading…
Cancel
Save