This article is based on Skywalking 6.6.0 To write , Except for the specific sections , theoretical support Skywalking 6.0+.

This paper discusses in detail Java Agent Configuration of .

Java Agent Supported configuration properties


This form is based on Skywalking 6.6.0, Official documents can be found in : , Other version configuration items Not exactly the same , Please send the link to v6.6.0 Change it to the version you are using .

Property name describe The default value is
agent.namespace Namespace , Used to isolate cross process propagation header. If configured ,header Will be for HeaderName:Namespace. Not set
agent.service_name stay SkyWalking UI The service name shown in .5.x The version corresponds to Application,6.x The version corresponds to Service. Suggest : Set a unique name for each service , Multiple service instances of a service have the same service name Your_ApplicationName
agent.sample_n_per_3_secs Negative or 0 It means no sampling , No sampling by default .SAMPLE_N_PER_3_SECS each 3 Second sampling N strip . Not set
agent.authentication Whether authentication is enabled depends on the configuration of the back end , You can see application.yml Detailed description of . For most scenarios , The back end needs to extend the authentication . At present, only the basic authentication function has been realized . Not set
agent.span_limit_per_segment Single segment Medium span Maximum number of . Through this configuration item ,Skywalking Assesses application memory usage . 300
agent.ignore_suffix If this set contains the first span Operation name of , This segment Will be ignored . Not set
agent.is_open_debugging_class If true,skywalking Will take all the Scriptures Instrument The converted class file is saved to /debugging Under the folder .Skywalking The team will ask you to provide these class files to solve the compatibility problem . Not set
agent.active_v2_header Whether to use by default v2 Version of header. true
agent.instance_uuid example id.skywalking Will give examples of id Think of the same as an example . If it is empty ,skywalking agent Will generate a 32 Bit uuid. ""
agent.instance_properties[key]=value Add custom properties of the service instance . Not set
agent.cause_exception_depth agent When the record is abnormal , The depth of the agent's entry 5
agent.active_v1_header Whether to use by default v1 Version of header. false
agent.cool_down_threshold received reset After the command , How long should the agent wait ( In minutes ) To re register with OAP The server . 10
agent.force_reconnection_period according to grpc_channel_check_interval Force reconnection grpc. 1
agent.operation_name_threshold operationName Maximum length , Setting this value to > 500. 500
collector.grpc_channel_check_interval Check grpc Of channel The time interval between States . 30
collector.app_and_service_register_check_interval Time interval to check the registration status of applications and services . 3
collector.backend_service receive skywalking trace Back end address of the data
collector.grpc_upstream_timeout grpc Timeout when client sends data upstream , Unit second . 30 second
logging.level The level of logging . The default is debug. DEBUG
logging.file_name Log file name skywalking-api.log
logging.output Log output , Default FILE.CONSOLE Means output to stdout. FILE
logging.dir Log directory . The default is empty string , Said the use of ”system.out” Output log . ""
logging.pattern Log format . All conversion specifiers :
* %level Indicates the log level .
* %timestamp It means the present time , Format yyyy-MM-dd HH:mm:ss:SSS.
* %thread Represents the name of the current thread .
* %msg A message .
* %class Express TargetClass Of SimpleName.
* %throwable Abnormal said .
* %agent_name Express agent.service_name
%level %timestamp %thread %class : %msg %throwable
logging.max_file_size Maximum log file size . When the log file size exceeds this number , Archive the current log file , Write the log to a new file . 300 * 1024 * 1024
logging.max_history_files Maximum history log file . When a flip occurs , If the log file exceeds this value , The earliest files will be deleted . By default , A negative number or zero means turn off . -1
jvm.buffer_size collect JVM The information of buffer Size . 60 * 10
buffer.channel_size buffer Of channel size . 5
buffer.buffer_size buffer Size 300
dictionary.service_code_buffer_size The buffer size of application codes and peer 10 * 10000
dictionary.endpoint_name_buffer_size The buffer size of endpoint names and peer 1000 * 10000
plugin.peer_max_length Peer Maximum description limit 200
plugin.mongodb.trace_param If true, Record all visits MongoDB Parameter information of . The default is false, Indicates that only the operation name is recorded , Parameter information is not recorded . false
plugin.mongodb.filter_length_limit If you set it to a positive number ,WriteRequest.params Will be truncated to that length , Otherwise it will be completely preserved , This can cause performance problems . 256
plugin.elasticsearch.trace_dsl If true, Record all visits ElasticSearch Of DSL Information . The default is false. false
plugin.springmvc.use_qualified_name_as_endpoint_name If true,endpoint Of name Give a fully qualified name to a method , It's not a request URL. The default is false. false
plugin.toolit.use_qualified_name_as_operation_name If true,operation Of name Give a fully qualified name to a method , Not given operation name. The default is false. false
plugin.mysql.trace_sql_parameters If set to true, Will collect sql Parameters of ( Usually it is java.sql.PreparedStatement). false
plugin.mysql.sql_parameters_max_length If set to a positive number ,db.sql.parameters Will be truncated to that length , Otherwise it will be completely preserved , This can cause performance problems . 512
plugin.postgresql.trace_sql_parameters If set to true, Will collect sql Parameters of ( Usually it is java.sql.PreparedStatement). false
plugin.postgresql.sql_parameters_max_length If set to a positive number ,db.sql.parameters Will be truncated to that length , Otherwise it will be completely preserved , This can cause performance problems . 512
plugin.solrj.trace_statement If true, It's in Solr All query parameters are tracked in the query request ( Include deleteByIds and deleteByQuery) false
plugin.solrj.trace_ops_params If true, Then track Solr All operation parameters in the request false
plugin.light4j.trace_handler_chain If true, Please follow up Light4J All middleware requested by / Business handler. false
plugin.opgroup.* Support the operation name to customize the rules of groups in different plug-ins . See Plug ins that support group rules Not set
plugin.springtransaction.simplify_transaction_definition_name Set to true, Simplify the transaction definition name . false
plugin.jdkthreading.threading_class_prefixes Will match the name with any THREADING_CLASS_PREFIXES ( Multiple uses , Separate ) Matching threaded classes ( java.lang.Runnable and java.util.concurrent.Callable ) And its subclasses Instrument, Make sure that only narrow prefixes are specified as you want Instrument The prefix of ( Safety considerations , java. and javax. Will be ignored ) Not set

Java Agent Configuration mode

agent There are many positions in the configuration , The above changes agent.config Value in file , It's just one of them . The following is devoted to agent Supported configuration mode .

System attribute (-D)

Use -Dskywalking. + agent.config In the configuration file key that will do . for example :

agent.config The file has an attribute named agent.service_name , So if you use system properties , So we can write this as

java -javaagent:/opt/agent/skywalking-agent.jar -Dskywalking.agent.service_name= The value you want to set -jar somr-spring-boot.jar

Proxy options

stay JVM After the proxy path in the parameter, add the attribute . Format :


for example :

java -javaagent:/opt/agent/skywalking-agent.jar=agent.service_name= The value you want to set -jar somr-spring-boot.jar

System environment variable

agent.config The default uppercase value in the file , Can be referenced as environment variables . for example ,agent.config It has the following contents


This explanation Skywalking I can read it and call it SW_AGENT_NAME Environment variables of .


Proxy options > System attribute (-D) > System environment variable > The configuration file

Reference documents

Related articles