Client start parameters

更新时间:
复制 MD 格式

When you connect an application to AHAS Application Protection, you can modify the client start parameters in the start command to control the client's behavior. This topic describes the supported start parameters for the client, software development kit (SDK), and Java Agent.

Client start parameters

NameDescriptionTypeDefault valueNotes
-Dproject.nameSpecifies the application name. The name appears in the application list of AHAS Application Protection.StringThe full name of the class where the Main function is located.Optional. Configuration is recommended.
-Dcsp.sentinel.app.typeSpecifies the application type.Int0 (APP_TYPE_COMMON)Optional. Supported in versions 1.3.0 and later. Manual configuration is not usually required.
-Dcsp.sentinel.metric.file.single.sizeThe size of a single monitoring log file.Long52428800 (50 MB)Optional
-Dcsp.sentinel.metric.file.total.countThe maximum number of monitoring log files.Int6Optional
-Dcsp.sentinel.statistic.max.rtThe maximum valid response time in milliseconds (ms). If the response time exceeds this value, it is recorded as this value.Int4900Optional
-Dcsp.sentinel.log.dirThe directory for Sentinel log files.String${user.home}/logs/csp/Optional
-Dcsp.sentinel.log.use.pidSpecifies whether to include the process ID in the log file name. This is used when multiple applications are deployed on a single machine.BooleanfalseOptional
-Dcsp.sentinel.log.output.typeThe output type for record logs. file indicates output to a file. console indicates output to the terminal.StringfileOptional. Supported in versions 1.3.6 and later.
-Dcsp.sentinel.heartbeat.interval.msThe heartbeat packet sending interval in milliseconds (ms).Long5 msOptional. If this parameter is not configured, the default value is fetched from the corresponding HeartbeatSender.
-Dcsp.sentinel.web.servlet.block.pageThe throttling page.StringnullOptional
-Dcsp.sentinel.url.clean.config.pathThe path of the configuration file for URL convergence rules.StringEmptyOptional
-Dcsp.sentinel.url.suffix.exclude.patternThe URL suffixes to converge.Stringpng,gif,mjs,css,htm,html,jpg,jpeg,map,ico,ttf,woffOptional
Note The versions listed refer to the ahas-sentinel-client version.

SDK start parameters

The following table lists the Spring Boot starter configuration items that AHAS supports.

Note Configure the following items in the application.properties configuration file.
Configuration itemDescriptionDefault value
spring.cloud.ahas.sentinel.aspectj.enabledAutomatically enables annotation support.true
spring.cloud.ahas.sentinel.mybatis.enabledAutomatically enables MyBatis instrumentation support.true
spring.cloud.ahas.sentinel.web.enabledAutomatically enables Spring Web instrumentation support.true
spring.cloud.ahas.sentinel.web.http-method-prefixIncludes the HTTP method prefix in Web instrumentation (since 1.5.3).false

Java Agent start parameters

Pass parameters using the -D option.

ParameterControlled pluginDefault status
ahas.sentinel.agent.plugin.web.spring.enabledSpring Web pluginEnabled
ahas.sentinel.agent.plugin.mybatis.enabledMyBatis pluginEnabled
ahas.sentinel.agent.plugin.dubbo.enabledDubbo pluginEnabled
ahas.sentinel.agent.plugin.grpc.enabledgRPC pluginEnabled
ahas.sentinel.agent.plugin.gateway.enabledAPI gateway pluginEnabled
ahas.sentinel.agent.plugin.web.servlet.enabledWeb Servlet pluginshutdown
ahas.sentinel.agent.plugin.db.enabledAll Java Database Connectivity (JDBC) pluginsDisabled
ahas.sentinel.agent.plugin.cache.enabledAll cache pluginsshutdown
ahas.sentinel.agent.plugin.mq.enabledAll MQ client pluginsshutdown

Example:

-Dahas.sentinel.agent.plugin.web.servlet.enabled=false