From ab4e6d08191e74c99c0aaf38406fee5a820be067 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Mon, 3 May 2021 10:31:29 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=BB=93=E6=9E=84=E8=B0=83?= =?UTF-8?q?=E6=95=B4=20x=2021=20:=20=E8=A7=A3=E5=86=B3=20opentracing=20?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E7=9A=84=E5=86=B2=E7=AA=81=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/deploy.sh | 4 ++-- yudao-admin-server/src/main/resources/application.yaml | 4 ++-- yudao-admin-server/src/main/resources/logback-spring.xml | 8 ++++---- yudao-dependencies/pom.xml | 8 +++++++- .../framework/operatelog/core/aop/OperateLogAspect.java | 2 +- yudao-framework/yudao-spring-boot-starter-monitor/pom.xml | 4 ++++ .../tracer/config/YudaoTracerAutoConfiguration.java | 2 +- .../yudao/framework/tracer/core/aop/BizTraceAspect.java | 7 ++++--- .../framework/mq/config/YudaoMQAutoConfiguration.java | 3 ++- 9 files changed, 27 insertions(+), 15 deletions(-) diff --git a/bin/deploy.sh b/bin/deploy.sh index 3a156c9b0f..ce295c7c1e 100644 --- a/bin/deploy.sh +++ b/bin/deploy.sh @@ -8,11 +8,11 @@ set -e DATE=$(date +%Y%m%d%H%M) # 基础路径 -BASE_PATH=/work/projects/dashboard +BASE_PATH=/work/projects/yudao-admin-server # 编译后 jar 的地址。部署时,Jenkins 会上传 jar 包到该目录下 SOURCE_PATH=$BASE_PATH/build # 服务名称。同时约定部署服务的 jar 包名字也为它。 -SERVER_NAME=dashboard +SERVER_NAME=yudao-admin-server # 环境 PROFILES_ACTIVE=dev # 健康检查 URL diff --git a/yudao-admin-server/src/main/resources/application.yaml b/yudao-admin-server/src/main/resources/application.yaml index 21227d5596..486d4a4877 100644 --- a/yudao-admin-server/src/main/resources/application.yaml +++ b/yudao-admin-server/src/main/resources/application.yaml @@ -56,7 +56,7 @@ yudao: db-schemas: ${spring.datasource.dynamic.datasource.master.name} error-code: # 错误码相关配置项 constants-class-list: - - cn.iocoder.dashboard.modules.infra.enums.InfErrorCodeConstants - - cn.iocoder.dashboard.modules.system.enums.SysErrorCodeConstants + - cn.iocoder.yudao.adminserver.modules.infra.enums.InfErrorCodeConstants + - cn.iocoder.yudao.adminserver.modules.system.enums.SysErrorCodeConstants debug: false diff --git a/yudao-admin-server/src/main/resources/logback-spring.xml b/yudao-admin-server/src/main/resources/logback-spring.xml index 1d9bec6dc5..5bc181fd26 100644 --- a/yudao-admin-server/src/main/resources/logback-spring.xml +++ b/yudao-admin-server/src/main/resources/logback-spring.xml @@ -58,19 +58,19 @@ - + - + - + - + diff --git a/yudao-dependencies/pom.xml b/yudao-dependencies/pom.xml index 7fab310919..5556b6be2c 100644 --- a/yudao-dependencies/pom.xml +++ b/yudao-dependencies/pom.xml @@ -36,6 +36,7 @@ 8.5.0 2.3.1 + 0.30.0 7.2.6.RELEASE 0.1.16 @@ -252,6 +253,11 @@ apm-toolkit-opentracing ${skywalking.version} + + io.opentracing + opentracing-util + ${opentracing.version} + de.codecentric @@ -379,7 +385,7 @@ io.opentracing - opentracing-noop + opentracing-util io.opentracing diff --git a/yudao-framework/yudao-spring-boot-starter-biz-operatelog/src/main/java/cn/iocoder/yudao/framework/operatelog/core/aop/OperateLogAspect.java b/yudao-framework/yudao-spring-boot-starter-biz-operatelog/src/main/java/cn/iocoder/yudao/framework/operatelog/core/aop/OperateLogAspect.java index 1c5580c7a9..a7f23a3912 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-operatelog/src/main/java/cn/iocoder/yudao/framework/operatelog/core/aop/OperateLogAspect.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-operatelog/src/main/java/cn/iocoder/yudao/framework/operatelog/core/aop/OperateLogAspect.java @@ -340,7 +340,7 @@ public class OperateLogAspect { // 递归,处理数组、Collection、Map 的情况 if (Collection.class.isAssignableFrom(clazz)) { return ((Collection) object).stream() - .anyMatch((Predicate) o -> isIgnoreArgs(object)); + .anyMatch((Predicate) OperateLogAspect::isIgnoreArgs); } if (Map.class.isAssignableFrom(clazz)) { return isIgnoreArgs(((Map) object).values()); diff --git a/yudao-framework/yudao-spring-boot-starter-monitor/pom.xml b/yudao-framework/yudao-spring-boot-starter-monitor/pom.xml index 7b3a315ae8..0fa5ac5d50 100644 --- a/yudao-framework/yudao-spring-boot-starter-monitor/pom.xml +++ b/yudao-framework/yudao-spring-boot-starter-monitor/pom.xml @@ -53,6 +53,10 @@ org.apache.skywalking apm-toolkit-opentracing + + io.opentracing + opentracing-util + de.codecentric diff --git a/yudao-framework/yudao-spring-boot-starter-monitor/src/main/java/cn/iocoder/yudao/framework/tracer/config/YudaoTracerAutoConfiguration.java b/yudao-framework/yudao-spring-boot-starter-monitor/src/main/java/cn/iocoder/yudao/framework/tracer/config/YudaoTracerAutoConfiguration.java index 6c2422a4e3..ce1bf86138 100644 --- a/yudao-framework/yudao-spring-boot-starter-monitor/src/main/java/cn/iocoder/yudao/framework/tracer/config/YudaoTracerAutoConfiguration.java +++ b/yudao-framework/yudao-spring-boot-starter-monitor/src/main/java/cn/iocoder/yudao/framework/tracer/config/YudaoTracerAutoConfiguration.java @@ -33,7 +33,7 @@ public class YudaoTracerAutoConfiguration { @Bean @ConditionalOnMissingBean public BizTraceAspect bizTracingAop() { - return new BizTraceAspect(); + return new BizTraceAspect(tracer()); } @Bean diff --git a/yudao-framework/yudao-spring-boot-starter-monitor/src/main/java/cn/iocoder/yudao/framework/tracer/core/aop/BizTraceAspect.java b/yudao-framework/yudao-spring-boot-starter-monitor/src/main/java/cn/iocoder/yudao/framework/tracer/core/aop/BizTraceAspect.java index 1bc9d18a7e..e4c6810d1f 100644 --- a/yudao-framework/yudao-spring-boot-starter-monitor/src/main/java/cn/iocoder/yudao/framework/tracer/core/aop/BizTraceAspect.java +++ b/yudao-framework/yudao-spring-boot-starter-monitor/src/main/java/cn/iocoder/yudao/framework/tracer/core/aop/BizTraceAspect.java @@ -6,6 +6,7 @@ import cn.iocoder.yudao.framework.tracer.core.annotation.BizTrace; import cn.iocoder.yudao.framework.common.util.sping.SpringExpressionUtils; import io.opentracing.Span; import io.opentracing.Tracer; +import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.annotation.Around; @@ -22,19 +23,19 @@ import static java.util.Arrays.asList; * @author mashu */ @Aspect +@AllArgsConstructor @Slf4j public class BizTraceAspect { private static final String BIZ_OPERATION_NAME_PREFIX = "Biz/"; - @Resource - private Tracer tracer; + private final Tracer tracer; @Around(value = "@annotation(trace)") public Object around(ProceedingJoinPoint joinPoint, BizTrace trace) throws Throwable { // 创建 span String operationName = getOperationName(joinPoint, trace); - Span span = tracer.buildSpan(operationName).startManual(); + Span span = tracer.buildSpan(operationName).start(); try { // 执行原有方法 return joinPoint.proceed(); diff --git a/yudao-framework/yudao-spring-boot-starter-mq/src/main/java/cn/iocoder/yudao/framework/mq/config/YudaoMQAutoConfiguration.java b/yudao-framework/yudao-spring-boot-starter-mq/src/main/java/cn/iocoder/yudao/framework/mq/config/YudaoMQAutoConfiguration.java index e105dd8f34..8b3366dd70 100644 --- a/yudao-framework/yudao-spring-boot-starter-mq/src/main/java/cn/iocoder/yudao/framework/mq/config/YudaoMQAutoConfiguration.java +++ b/yudao-framework/yudao-spring-boot-starter-mq/src/main/java/cn/iocoder/yudao/framework/mq/config/YudaoMQAutoConfiguration.java @@ -3,6 +3,7 @@ package cn.iocoder.yudao.framework.mq.config; import cn.hutool.system.SystemUtil; import cn.iocoder.yudao.framework.mq.core.pubsub.AbstractChannelMessageListener; import cn.iocoder.yudao.framework.mq.core.stream.AbstractStreamMessageListener; +import cn.iocoder.yudao.framework.redis.config.YudaoRedisAutoConfiguration; import lombok.extern.slf4j.Slf4j; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration; @@ -26,7 +27,7 @@ import java.util.List; * @author 芋道源码 */ @Configuration -@AutoConfigureAfter(YudaoMQAutoConfiguration.class) +@AutoConfigureAfter(YudaoRedisAutoConfiguration.class) @Slf4j public class YudaoMQAutoConfiguration {