Configure collector push address (#296)
* "配置化collector推送地址" * "配置化collector推送地址" Co-authored-by: 孙宇 <suny129@chinaunicom.cn>
This commit is contained in:
parent
fb6e789909
commit
bc884175be
|
@ -27,8 +27,8 @@ func Init(prefix string, addr ...string) {
|
||||||
|
|
||||||
} else if file.IsExist(path.Join(runner.Cwd, "etc", "address.yml")) {
|
} else if file.IsExist(path.Join(runner.Cwd, "etc", "address.yml")) {
|
||||||
//address.yml 存在,则使用配置文件的地址
|
//address.yml 存在,则使用配置文件的地址
|
||||||
port := address.GetHTTPPort("collector")
|
newAddr := address.GetHTTPAddresses("collector")
|
||||||
PushUrl = fmt.Sprintf("http://127.0.0.1:%d/api/collector/push", port)
|
PushUrl = fmt.Sprintf("http://%s/api/collector/push", newAddr[0])
|
||||||
}
|
}
|
||||||
|
|
||||||
Counter = NewCounter(prefix)
|
Counter = NewCounter(prefix)
|
||||||
|
|
Loading…
Reference in New Issue