diff --git a/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/conf/Config.java b/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/conf/Config.java index 2553cca84a7d90e1500cdecf832ec0dbec22118f..14ef3a0a471491ab789857c15128588508f6b31b 100644 --- a/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/conf/Config.java +++ b/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/conf/Config.java @@ -40,7 +40,7 @@ public class Config { public static String NAMESPACE = ""; /** - * Application code is showed in skywalking-ui. Suggestion: set a unique name for each service, + * Service name is showed in skywalking-ui. Suggestion: set a unique name for each service, * service instance nodes share the same code */ public static String SERVICE_NAME = ""; diff --git a/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/conf/SnifferConfigInitializer.java b/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/conf/SnifferConfigInitializer.java index f17336b811fec76582015617cff22e51c98bfec0..1d7c30df583885e272a53f1bd35c84ebc7b88ff2 100644 --- a/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/conf/SnifferConfigInitializer.java +++ b/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/conf/SnifferConfigInitializer.java @@ -54,11 +54,11 @@ public class SnifferConfigInitializer { * specified agent config path is not set , the agent will try to locate `agent.config`, which should be in the * /config dictionary of agent package. *
- * Also try to override the config by system.env and system.properties. All the keys in these two places should - * start with {@link #ENV_KEY_PREFIX}. e.g. in env `skywalking.agent.application_code=yourAppName` to override - * `agent.application_code` in config file. + * Also try to override the config by system.properties. All the keys in this place should + * start with {@link #ENV_KEY_PREFIX}. e.g. in env `skywalking.agent.service_name=yourAppName` to override + * `agent.service_name` in config file. *
- * At the end, `agent.application_code` and `collector.servers` must be not blank. + * At the end, `agent.service_name` and `collector.servers` must be not blank. */ public static void initialize(String agentOptions) throws ConfigNotFoundException, AgentPackageNotFoundException { InputStreamReader configFileStream; @@ -80,7 +80,7 @@ public class SnifferConfigInitializer { try { overrideConfigBySystemProp(); } catch (Exception e) { - logger.error(e, "Failed to read the system env."); + logger.error(e, "Failed to read the system properties."); } if (!StringUtil.isEmpty(agentOptions)) { @@ -95,10 +95,10 @@ public class SnifferConfigInitializer { } if (StringUtil.isEmpty(Config.Agent.SERVICE_NAME)) { - throw new ExceptionInInitializerError("`agent.service_code` is missing."); + throw new ExceptionInInitializerError("`agent.service_name` is missing."); } if (StringUtil.isEmpty(Config.Collector.BACKEND_SERVICE)) { - throw new ExceptionInInitializerError("`collector.direct_servers` and `collector.servers` cannot be empty at the same time."); + throw new ExceptionInInitializerError("`collector.backend_service` is missing."); } IS_INIT_COMPLETED = true; @@ -149,12 +149,11 @@ public class SnifferConfigInitializer { } /** - * Override the config by system properties. The env key must start with `skywalking`, the reuslt should be as same + * Override the config by system properties. The property key must start with `skywalking`, the result should be as same * as in `agent.config` *
- * such as: Env key of `agent.application_code` shoule be `skywalking.agent.application_code`
+ * such as: Property key of `agent.service_name` should be `skywalking.agent.service_name`
*
- * @return the config file {@link InputStream}, or null if not needEnhance.
*/
private static void overrideConfigBySystemProp() throws IllegalAccessException {
Properties properties = new Properties();
@@ -162,8 +161,9 @@ public class SnifferConfigInitializer {
Iterator