Skip to content

Commit 7c279d7

Browse files
committed
fix the operation name of spring mvc span is incorrect
1 parent 2503604 commit 7c279d7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-4.x-plugin/src/main/java/org/skywalking/apm/plugin/spring/mvc/ControllerConstructorInterceptor.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@ public void onConstruct(EnhancedInstance objInst, Object[] allArguments) {
2424
String basePath = "";
2525
RequestMapping basePathRequestMapping = objInst.getClass().getAnnotation(RequestMapping.class);
2626
if (basePathRequestMapping != null) {
27-
basePath = basePathRequestMapping.value()[0];
27+
if (basePathRequestMapping.value().length > 0) {
28+
basePath = basePathRequestMapping.value()[0];
29+
} else if (basePathRequestMapping.path().length > 0) {
30+
basePath = basePathRequestMapping.path()[0];
31+
}
2832
}
2933
PathMappingCache pathMappingCache = new PathMappingCache(basePath);
3034
objInst.setSkyWalkingDynamicField(pathMappingCache);

0 commit comments

Comments
 (0)