nz-talon首次提交
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
package net.geedge.confagent.controller;
|
||||
|
||||
import cn.hutool.log.Log;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
|
||||
public abstract class BaseController {
|
||||
private Log log = Log.get();
|
||||
|
||||
protected static final String PROMTAIL_LISTEN_SERVER = "server";
|
||||
protected static final String PROMTAIL_LISTEN_PORT = "http_listen_port";
|
||||
|
||||
@Value("${confagent.tokenFile:config/token.auth}")
|
||||
protected String tokenFile; //token文件位置
|
||||
|
||||
@Value("${confagent.promtail.cmdLine}")
|
||||
protected String promtailCmdLinePath; // promtail config.conf 启动参数文件存放位置
|
||||
|
||||
@Value("${confagent.promtail.defaultIP:127.0.0.1}")
|
||||
protected String defaultPromtailIP; //promtail 默认监听ip
|
||||
|
||||
protected static final int DEFAULT_PROMTAIL_PORT=9080; //prometheus 默认监听端口
|
||||
|
||||
@Value("${confagent.promtail.config}")
|
||||
protected String promtailConfPath;
|
||||
|
||||
/**
|
||||
* 调用 /-/reload 接口,热加载 server 配置文件,
|
||||
*
|
||||
* @param cmdLinePath
|
||||
* @param serverListenAddr
|
||||
* @param defaultServerPort
|
||||
* @param defaultServerIP
|
||||
* @return
|
||||
*/
|
||||
// public boolean reloadServerConfiguration(String cmdLinePath, String serverListenAddr, int defaultServerPort, String defaultServerIP) {
|
||||
// UrlBuilder serverReloadUrl = new UrlBuilder();
|
||||
// int serverPort = ConfagentUtil.getConfFilePort(cmdLinePath, serverListenAddr, defaultServerPort);
|
||||
// serverReloadUrl.setScheme("http").setHost(defaultServerIP).setPort(serverPort).addPath("/-/reload");
|
||||
//
|
||||
// String url = serverReloadUrl.toString();
|
||||
// HttpRequest post = Tool.HttpUtil.createPost(url);
|
||||
// HttpResponse response = post.execute();
|
||||
// return 200 == response.getStatus();
|
||||
// }
|
||||
}
|
||||
Reference in New Issue
Block a user