1.修改本地埋点异常没有处理的问题。
2.在conf中增加一个配置,可以通过配置而非环境变量控制授权开放情况。 3.修改部分日志输出内容。
This commit is contained in:
parent
28754fb01d
commit
15bfbc0355
|
|
@ -52,6 +52,4 @@ public class LocalBuriedPointSender extends ApplicationExceptionHandler implemen
|
|||
ContextBuffer.save(spanData);
|
||||
}
|
||||
}
|
||||
|
||||
public void handleException(Throwable e) {}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,8 @@ public class Config {
|
|||
public static String APPLICATION_CODE = "";
|
||||
|
||||
public static String AUTH_SYSTEM_ENV_NAME = "SKYWALKING_RUN";
|
||||
|
||||
public static boolean AUTH_OVERRIDE = false;
|
||||
}
|
||||
|
||||
public static class BuriedPoint {
|
||||
|
|
|
|||
|
|
@ -9,24 +9,30 @@ import java.util.Properties;
|
|||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import static com.ai.cloud.skywalking.conf.Config.SkyWalking.*;
|
||||
|
||||
public class ConfigInitializer {
|
||||
private static Logger logger = Logger.getLogger(ConfigInitializer.class.getName());
|
||||
|
||||
public static void initialize() {
|
||||
InputStream inputStream = ConfigInitializer.class.getResourceAsStream("/sky-walking.auth");
|
||||
if (inputStream == null) {
|
||||
logger.log(Level.ALL, "No provider sky-walking certification documents, buried point won't work");
|
||||
logger.log(Level.ALL, "No provider sky-walking certification documents, sky-walking api auto shutdown.");
|
||||
} else {
|
||||
try {
|
||||
Properties properties = new Properties();
|
||||
properties.load(inputStream);
|
||||
initNextLevel(properties, Config.class, new ConfigDesc());
|
||||
AuthDesc.isAuth = Boolean.valueOf(System.getenv(Config.SkyWalking.AUTH_SYSTEM_ENV_NAME));
|
||||
logger.log(Level.ALL, "skywalking auth check : " + AuthDesc.isAuth);
|
||||
AuthDesc.isAuth = Boolean.valueOf(System.getenv(AUTH_SYSTEM_ENV_NAME));
|
||||
logger.log(Level.ALL, "sky-walking auth check : " + AuthDesc.isAuth);
|
||||
if(!AuthDesc.isAuth && AUTH_OVERRIDE){
|
||||
AuthDesc.isAuth = AUTH_OVERRIDE;
|
||||
logger.log(Level.ALL, "sky-walking auth override: " + AuthDesc.isAuth);
|
||||
}
|
||||
} catch (IllegalAccessException e) {
|
||||
logger.log(Level.ALL, "Parsing certification file failed, buried won't work");
|
||||
logger.log(Level.ALL, "Parsing certification file failed, sky-walking api auto shutdown.");
|
||||
} catch (IOException e) {
|
||||
logger.log(Level.ALL, "Failed to read the certification file, buried won't work");
|
||||
logger.log(Level.ALL, "Failed to read the certification file, sky-walking api auto shutdown.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue