Add `MOUNT` config in the agent core. (#5529)

This commit is contained in:
吴晟 Wu Sheng 2020-09-22 07:14:34 +08:00 committed by GitHub
parent e200ef1045
commit 075cb981a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 6 deletions

View File

@ -18,7 +18,9 @@
package org.apache.skywalking.apm.agent.core.conf;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.skywalking.apm.agent.core.context.trace.TraceSegment;
import org.apache.skywalking.apm.agent.core.logging.core.LogLevel;
@ -122,7 +124,6 @@ public class Config {
* Keep tracing even the backend is not available.
*/
public static boolean KEEP_TRACING = false;
}
public static class OsInfo {
@ -292,6 +293,11 @@ public class Config {
* Exclude activated plugins
*/
public static String EXCLUDE_PLUGINS = "";
/**
* Mount the folders of the plugins. The folder path is relative to agent.jar.
*/
public static List<String> MOUNT = Arrays.asList("plugins", "activations");
}
public static class Correlation {

View File

@ -35,6 +35,7 @@ import lombok.RequiredArgsConstructor;
import org.apache.skywalking.apm.agent.core.boot.AgentPackageNotFoundException;
import org.apache.skywalking.apm.agent.core.boot.AgentPackagePath;
import org.apache.skywalking.apm.agent.core.boot.PluginConfig;
import org.apache.skywalking.apm.agent.core.conf.Config;
import org.apache.skywalking.apm.agent.core.conf.SnifferConfigInitializer;
import org.apache.skywalking.apm.agent.core.logging.api.ILog;
import org.apache.skywalking.apm.agent.core.logging.api.LogManager;
@ -85,8 +86,7 @@ public class AgentClassLoader extends ClassLoader {
super(parent);
File agentDictionary = AgentPackagePath.getPath();
classpath = new LinkedList<>();
classpath.add(new File(agentDictionary, "plugins"));
classpath.add(new File(agentDictionary, "activations"));
Config.Plugin.MOUNT.forEach(mountFolder -> classpath.add(new File(agentDictionary, mountFolder)));
}
@Override

View File

@ -92,14 +92,17 @@ logging.level=${SW_LOGGING_LEVEL:INFO}
# The max recursive depth when checking the exception traced by the agent. Typically, we don't recommend setting this more than 10, which could cause a performance issue. Negative value and 0 would be ignored, which means all exceptions would make the span tagged in error status.
# statuscheck.max_recursive_depth=${SW_STATUSCHECK_MAX_RECURSIVE_DEPTH:1}
# Mount the specific folders of the plugins. Plugins in mounted folders would work.
plugin.mount=${SW_MOUNT_FOLDERS:plugins,activations}
# Exclude activated plugins
# plugin.exclude_plugins=${SW_EXCLUDE_PLUGINS:}
# mysql plugin configuration
# plugin.mysql.trace_sql_parameters=${SW_MYSQL_TRACE_SQL_PARAMETERS:false}
# Kafka producer configuration
# plugin.kafka.bootstrap_servers=${SW_KAFKA_BOOTSTRAP_SERVERS:localhost:9092}
# Exclude activated plugins
# plugin.exclude_plugins=${SW_EXCLUDE_PLUGINS:}
# Match spring bean with regex expression for classname
# plugin.springannotation.classname_match_regex=${SW_SPRINGANNOTATION_CLASSNAME_MATCH_REGEX:}

View File

@ -113,6 +113,7 @@ property key | Description | Default |
`meter.active`|If true, the agent collects and reports metrics to the backend.|`true`|
`meter.report_interval`|Report meters interval. The unit is second|`20`|
`meter.max_meter_size`| Max size of the meter pool |`500`|
`plugin.mount` | Mount the specific folders of the plugins. Plugins in mounted folders would work. | `plugins,activations` |
`plugin.peer_max_length `|Peer maximum description limit.|`200`|
`plugin.exclude_plugins `|Exclude some plugins define in plugins dir.Plugin names is defined in [Agent plugin list](Plugin-list.md)|`""`|
`plugin.mongodb.trace_param`|If true, trace all the parameters in MongoDB access, default is false. Only trace the operation, not include parameters.|`false`|