This commit makes TraceRpcAutoConfiguration happens only when (#1628)
RpcTracing so that excluding brave-instrumentation-rpc dependency does't make an exception. Also add an missing property to disable RPC tracing in additional-spring-configuration-metadata.json
This commit is contained in:
@@ -28,6 +28,7 @@ import brave.sampler.SamplerFunction;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.cloud.sleuth.autoconfig.TraceAutoConfiguration;
|
||||
@@ -45,6 +46,7 @@ import org.springframework.lang.Nullable;
|
||||
@ConditionalOnProperty(name = "spring.sleuth.rpc.enabled", havingValue = "true",
|
||||
matchIfMissing = true)
|
||||
@ConditionalOnBean(Tracing.class)
|
||||
@ConditionalOnClass(RpcTracing.class)
|
||||
@AutoConfigureAfter(TraceAutoConfiguration.class)
|
||||
public class TraceRpcAutoConfiguration {
|
||||
|
||||
|
||||
@@ -65,6 +65,12 @@
|
||||
"type": "java.lang.Boolean",
|
||||
"description": "Enable DefaultKafkaHeaderMapper tracing for Kafka.",
|
||||
"defaultValue": true
|
||||
},
|
||||
{
|
||||
"name": "spring.sleuth.rpc.enabled",
|
||||
"type": "java.lang.Boolean",
|
||||
"description": "Enable tracing of RPC.",
|
||||
"defaultValue": true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user