Dynamic configuration items
By default, Tracer generates detailed and statistical logs for calls to various network middleware. Because Tracer generates logs asynchronously, this process has a minimal impact on performance. However, for special requirements, Tracer provides a dynamic configuration switch to disable middleware digest logs.
The dynamic configuration for Tracer provides switches at two levels:
Global switch
A global switch is a site-wide configuration that is pushed to all systems that use Tracer. The dynamic configuration backend already contains the global dynamic configuration. The resource ID for this dynamic configuration is:
Alipay.middlewareTracer:name=com.alipay.common.tracer.manage.TracerDrmIt contains one resource property:
disableMiddlewareDigestLogThe following describes the specific values to push for this field:
If the pushed value is true, all digest logs are disabled.
If the pushed value is false or an empty string, all digest logs are enabled.
If the pushed value is log1=true&log2=true, specific digest logs are disabled. In this format,
log1andlog2represent the keys for the logs. To disable multiple logs, separate them with an ampersand (&). The available keys are:rpc-client: RPCClient digest logrpc-server: RPCServer digest logmsg-publisher: MSG Publisher digest logmsg-subscriber: MSG Subscriber digest loghttp-client: HTTPClient digest logmvc: MVC digest logzdal-db: ZDALDB digest logzdal-tair: ZDALTAIR digest log
Push examples:
// Disable all digest logs
true
// Enable all digest logs
false
// Disable the zdal-db digest log
zdal-db=true
// Disable the zdal-db and rpc-client digest logs
zdal-db=true&rpc-client=trueIf you have disabled multiple logs and want to re-enable one of them, remove the corresponding log key from the pushed value. For example:
// The zdal-db and rpc-client digest logs are already disabled
zdal-db=true&rpc-client=true
// To enable the rpc-client log, push the following value
zdal-db=trueApplication-level switch
The properties for the application-level switch are the same as those for the global switch. The only difference is the dynamic configuration ID:
Alipay.${appName}:name=com.alipay.common.tracer.manage.TracerDrmBy default, this dynamic configuration is not configured in the dynamic configuration backend. To use it, you can add this configuration to your application. Follow these steps:
In your local SOFABoot project, import the following dependencies:
<dependency> <groupId>com.alipay.sofa</groupId> <artifactId>ddcs-enterprise-sofa-boot-starter</artifactId> <exclusions> <exclusion> <artifactId>tracer</artifactId> <groupId>com.alipay.common</groupId> </exclusion> </exclusions> </dependency> <dependency> <groupId>com.alipay.common</groupId> <artifactId>tracer-manage</artifactId> </dependency>Configure the dynamic configuration resource bean. The following is an example:
<bean id="tracerDrm" class="com.alipay.common.tracer.manage.TracerDrm" init-method="init"> <constructor-arg name="appName" value="tracerDrmBoot"/> </bean>Go to the Microservice Platform > Microservices > Dynamic Configuration page in the console. Add application metadata, and then create and push the corresponding dynamic configuration. For more information, see Get started with Dynamic Configuration > Manage dynamic configuration classes in the cloud.