未验证 提交 bc884175 编写于 作者: S sunyu 提交者: GitHub

Configure collector push address (#296)

* "配置化collector推送地址"

* "配置化collector推送地址"
Co-authored-by: N孙宇 <suny129@chinaunicom.cn>
上级 fb6e7899
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册