spring-annotation plugin add component (#5160)
This commit is contained in:
parent
925c0d74c7
commit
3a00d84766
|
|
@ -166,4 +166,6 @@ public class ComponentsDefine {
|
|||
public static final OfficialComponent BRPC_JAVA = new OfficialComponent(91, "brpc-java");
|
||||
|
||||
public static final OfficialComponent GRAPHQL = new OfficialComponent(92, "GraphQL");
|
||||
|
||||
public static final OfficialComponent SPRING_ANNOTATION = new OfficialComponent(93, "spring-annotation");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,16 +20,19 @@ package org.apache.skywalking.apm.plugin.spring.annotations;
|
|||
|
||||
import java.lang.reflect.Method;
|
||||
import org.apache.skywalking.apm.agent.core.context.ContextManager;
|
||||
import org.apache.skywalking.apm.agent.core.context.trace.AbstractSpan;
|
||||
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;
|
||||
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor;
|
||||
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult;
|
||||
import org.apache.skywalking.apm.network.trace.component.ComponentsDefine;
|
||||
|
||||
public class SpringAnnotationInterceptor implements InstanceMethodsAroundInterceptor {
|
||||
@Override
|
||||
public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes,
|
||||
MethodInterceptResult result) throws Throwable {
|
||||
String operationName = objInst.getClass().getName() + "." + method.getName();
|
||||
ContextManager.createLocalSpan(operationName);
|
||||
AbstractSpan span = ContextManager.createLocalSpan(operationName);
|
||||
span.setComponent(ComponentsDefine.SPRING_ANNOTATION);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -308,6 +308,9 @@ brpc-java:
|
|||
GraphQL:
|
||||
id: 92
|
||||
languages: Java
|
||||
spring-annotation:
|
||||
id: 93
|
||||
languages: Java
|
||||
|
||||
# .NET/.NET Core components
|
||||
# [3000, 4000) for C#/.NET only
|
||||
|
|
|
|||
|
|
@ -38,15 +38,15 @@ segmentItems:
|
|||
spans:
|
||||
- {operationName: test.org.apache.skywalking.apm.testcase.spring3.component.TestComponentBean.componentMethod,
|
||||
operationId: 0, parentSpanId: 1, spanId: 2, spanLayer: Unknown, startTime: nq
|
||||
0, endTime: nq 0, componentId: 0, isError: false, spanType: Local, peer: '',
|
||||
0, endTime: nq 0, componentId: 93, isError: false, spanType: Local, peer: '',
|
||||
skipAnalysis: 'false'}
|
||||
- {operationName: test.org.apache.skywalking.apm.testcase.spring3.dao.TestRepositoryBean.doSomeStuff,
|
||||
operationId: 0, parentSpanId: 1, spanId: 3, spanLayer: Unknown, startTime: nq
|
||||
0, endTime: nq 0, componentId: 0, isError: false, spanType: Local, peer: '',
|
||||
0, endTime: nq 0, componentId: 93, isError: false, spanType: Local, peer: '',
|
||||
skipAnalysis: 'false'}
|
||||
- {operationName: test.org.apache.skywalking.apm.testcase.spring3.service.TestServiceBean.doSomeBusiness,
|
||||
operationId: 0, parentSpanId: 0, spanId: 1, spanLayer: Unknown, startTime: nq
|
||||
0, endTime: nq 0, componentId: 0, isError: false, spanType: Local, peer: '',
|
||||
0, endTime: nq 0, componentId: 93, isError: false, spanType: Local, peer: '',
|
||||
skipAnalysis: 'false'}
|
||||
- operationName: /case/spring3
|
||||
operationId: 0
|
||||
|
|
|
|||
|
|
@ -38,15 +38,15 @@ segmentItems:
|
|||
spans:
|
||||
- {operationName: test.org.apache.skywalking.apm.testcase.spring3.component.TestComponentBean.componentMethod,
|
||||
operationId: 0, parentSpanId: 1, spanId: 2, spanLayer: Unknown, startTime: nq
|
||||
0, endTime: nq 0, componentId: 0, isError: false, spanType: Local, peer: '',
|
||||
0, endTime: nq 0, componentId: 93, isError: false, spanType: Local, peer: '',
|
||||
skipAnalysis: 'false'}
|
||||
- {operationName: test.org.apache.skywalking.apm.testcase.spring3.dao.TestRepositoryBean.doSomeStuff,
|
||||
operationId: 0, parentSpanId: 1, spanId: 3, spanLayer: Unknown, startTime: nq
|
||||
0, endTime: nq 0, componentId: 0, isError: false, spanType: Local, peer: '',
|
||||
0, endTime: nq 0, componentId: 93, isError: false, spanType: Local, peer: '',
|
||||
skipAnalysis: 'false'}
|
||||
- {operationName: test.org.apache.skywalking.apm.testcase.spring3.service.TestServiceBean.doSomeBusiness,
|
||||
operationId: 0, parentSpanId: 0, spanId: 1, spanLayer: Unknown, startTime: nq
|
||||
0, endTime: nq 0, componentId: 0, isError: false, spanType: Local, peer: '',
|
||||
0, endTime: nq 0, componentId: 93, isError: false, spanType: Local, peer: '',
|
||||
skipAnalysis: 'false'}
|
||||
- operationName: /case/spring3
|
||||
operationId: 0
|
||||
|
|
|
|||
|
|
@ -38,15 +38,15 @@ segmentItems:
|
|||
spans:
|
||||
- {operationName: test.org.apache.skywalking.apm.testcase.spring3.component.TestComponentBean.componentMethod,
|
||||
operationId: 0, parentSpanId: 1, spanId: 2, spanLayer: Unknown, startTime: nq
|
||||
0, endTime: nq 0, componentId: 0, isError: false, spanType: Local, peer: '',
|
||||
0, endTime: nq 0, componentId: 93, isError: false, spanType: Local, peer: '',
|
||||
skipAnalysis: 'false'}
|
||||
- {operationName: test.org.apache.skywalking.apm.testcase.spring3.dao.TestRepositoryBean.doSomeStuff,
|
||||
operationId: 0, parentSpanId: 1, spanId: 3, spanLayer: Unknown, startTime: nq
|
||||
0, endTime: nq 0, componentId: 0, isError: false, spanType: Local, peer: '',
|
||||
0, endTime: nq 0, componentId: 93, isError: false, spanType: Local, peer: '',
|
||||
skipAnalysis: 'false'}
|
||||
- {operationName: test.org.apache.skywalking.apm.testcase.spring3.service.TestServiceBean.doSomeBusiness,
|
||||
operationId: 0, parentSpanId: 0, spanId: 1, spanLayer: Unknown, startTime: nq
|
||||
0, endTime: nq 0, componentId: 0, isError: false, spanType: Local, peer: '',
|
||||
0, endTime: nq 0, componentId: 93, isError: false, spanType: Local, peer: '',
|
||||
skipAnalysis: 'false'}
|
||||
- operationName: /case/spring3
|
||||
operationId: 0
|
||||
|
|
|
|||
|
|
@ -38,15 +38,15 @@ segmentItems:
|
|||
spans:
|
||||
- {operationName: test.org.apache.skywalking.apm.testcase.spring3.component.TestComponentBean.componentMethod,
|
||||
operationId: 0, parentSpanId: 1, spanId: 2, spanLayer: Unknown, startTime: nq
|
||||
0, endTime: nq 0, componentId: 0, isError: false, spanType: Local, peer: '',
|
||||
0, endTime: nq 0, componentId: 93, isError: false, spanType: Local, peer: '',
|
||||
skipAnalysis: 'false'}
|
||||
- {operationName: test.org.apache.skywalking.apm.testcase.spring3.dao.TestRepositoryBean.doSomeStuff,
|
||||
operationId: 0, parentSpanId: 1, spanId: 3, spanLayer: Unknown, startTime: nq
|
||||
0, endTime: nq 0, componentId: 0, isError: false, spanType: Local, peer: '',
|
||||
0, endTime: nq 0, componentId: 93, isError: false, spanType: Local, peer: '',
|
||||
skipAnalysis: 'false'}
|
||||
- {operationName: test.org.apache.skywalking.apm.testcase.spring3.service.TestServiceBean.doSomeBusiness,
|
||||
operationId: 0, parentSpanId: 0, spanId: 1, spanLayer: Unknown, startTime: nq
|
||||
0, endTime: nq 0, componentId: 0, isError: false, spanType: Local, peer: '',
|
||||
0, endTime: nq 0, componentId: 93, isError: false, spanType: Local, peer: '',
|
||||
skipAnalysis: 'false'}
|
||||
- operationName: /case/spring3
|
||||
operationId: 0
|
||||
|
|
|
|||
Loading…
Reference in New Issue