4cc45d73
dark
将 bizType 和 bizId...
|
1
2
3
4
5
6
7
8
|
package cn.iocoder.dashboard.common.annotation;
import cn.iocoder.dashboard.util.sping.SpElUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.skywalking.apm.toolkit.trace.ActiveSpan;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
|
4cc45d73
dark
将 bizType 和 bizId...
|
9
|
import org.springframework.context.annotation.Configuration;
|
4cc45d73
dark
将 bizType 和 bizId...
|
10
|
|
5f45f73c
dark
去除无效引用,添加注释
|
11
12
13
14
15
|
/**
* 业务链路AOP切面
*
* @author mashu
*/
|
4cc45d73
dark
将 bizType 和 bizId...
|
16
17
18
19
20
21
|
@Aspect
@Slf4j
@Configuration
public class BizTracingAop {
@Around(value = "@annotation(bizTracing)")
|
5f45f73c
dark
去除无效引用,添加注释
|
22
|
public void tagBizInfo(ProceedingJoinPoint joinPoint, BizTracing bizTracing) {
|
4cc45d73
dark
将 bizType 和 bizId...
|
23
24
25
26
27
28
29
|
String bizId = SpElUtil.analysisSpEl(bizTracing.bizId(), joinPoint);
String bizType = SpElUtil.analysisSpEl(bizTracing.bizType(), joinPoint);
log.info("accept biz: bizId[{}], bizType[{}].", bizId, bizType);
ActiveSpan.tag(BizTracing.BIZ_ID, bizId);
ActiveSpan.tag(BizTracing.BIZ_TYPE, bizType);
}
}
|