fix the operation name of spring mvc span is incorrect

This commit is contained in:
ascrutae 2017-09-27 15:53:34 +08:00
parent 25036048ae
commit 7c279d7da7
1 changed files with 5 additions and 1 deletions

View File

@ -24,7 +24,11 @@ public class ControllerConstructorInterceptor implements InstanceConstructorInte
String basePath = "";
RequestMapping basePathRequestMapping = objInst.getClass().getAnnotation(RequestMapping.class);
if (basePathRequestMapping != null) {
basePath = basePathRequestMapping.value()[0];
if (basePathRequestMapping.value().length > 0) {
basePath = basePathRequestMapping.value()[0];
} else if (basePathRequestMapping.path().length > 0) {
basePath = basePathRequestMapping.path()[0];
}
}
PathMappingCache pathMappingCache = new PathMappingCache(basePath);
objInst.setSkyWalkingDynamicField(pathMappingCache);