reactor:优化日志格式,解决 FILE 里存在 highlight、cyan高亮
reactor:弱化对 skywalking 依赖,可按需引入,更灵活
This commit is contained in:
@@ -44,18 +44,22 @@
|
||||
<dependency>
|
||||
<groupId>io.opentracing</groupId>
|
||||
<artifactId>opentracing-util</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.skywalking</groupId>
|
||||
<artifactId>apm-toolkit-trace</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.skywalking</groupId>
|
||||
<artifactId>apm-toolkit-logback-1.x</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.skywalking</groupId>
|
||||
<artifactId>apm-toolkit-opentracing</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<!-- Micrometer 对 Prometheus 的支持 -->
|
||||
|
||||
@@ -3,6 +3,9 @@ package cn.iocoder.yudao.framework.tracer.config;
|
||||
import cn.iocoder.yudao.framework.common.enums.WebFilterOrderEnum;
|
||||
import cn.iocoder.yudao.framework.tracer.core.aop.BizTraceAspect;
|
||||
import cn.iocoder.yudao.framework.tracer.core.filter.TraceFilter;
|
||||
import io.opentracing.Tracer;
|
||||
import io.opentracing.util.GlobalTracer;
|
||||
import org.apache.skywalking.apm.toolkit.opentracing.SkywalkingTracer;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
@@ -16,30 +19,32 @@ import org.springframework.context.annotation.Bean;
|
||||
* @author mashu
|
||||
*/
|
||||
@AutoConfiguration
|
||||
@ConditionalOnClass({BizTraceAspect.class})
|
||||
@ConditionalOnClass(name = {
|
||||
"org.apache.skywalking.apm.toolkit.opentracing.SkywalkingTracer",
|
||||
"io.opentracing.Tracer"
|
||||
})
|
||||
@EnableConfigurationProperties(TracerProperties.class)
|
||||
@ConditionalOnProperty(prefix = "yudao.tracer", value = "enable", matchIfMissing = true)
|
||||
public class YudaoTracerAutoConfiguration {
|
||||
|
||||
// TODO @芋艿:重要。目前 opentracing 版本存在冲突,要么保证 skywalking,要么保证阿里云短信 sdk
|
||||
// @Bean
|
||||
// public TracerProperties bizTracerProperties() {
|
||||
// return new TracerProperties();
|
||||
// }
|
||||
//
|
||||
// @Bean
|
||||
// public BizTraceAspect bizTracingAop() {
|
||||
// return new BizTraceAspect(tracer());
|
||||
// }
|
||||
//
|
||||
// @Bean
|
||||
// public Tracer tracer() {
|
||||
// // 创建 SkywalkingTracer 对象
|
||||
// SkywalkingTracer tracer = new SkywalkingTracer();
|
||||
// // 设置为 GlobalTracer 的追踪器
|
||||
// GlobalTracer.register(tracer);
|
||||
// return tracer;
|
||||
// }
|
||||
@Bean
|
||||
public TracerProperties bizTracerProperties() {
|
||||
return new TracerProperties();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public BizTraceAspect bizTracingAop() {
|
||||
return new BizTraceAspect(tracer());
|
||||
}
|
||||
|
||||
@Bean
|
||||
public Tracer tracer() {
|
||||
// 创建 SkywalkingTracer 对象
|
||||
SkywalkingTracer tracer = new SkywalkingTracer();
|
||||
// 设置为 GlobalTracer 的追踪器
|
||||
GlobalTracer.registerIfAbsent(tracer);
|
||||
return tracer;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建 TraceFilter 过滤器,响应 header 设置 traceId
|
||||
|
||||
Reference in New Issue
Block a user