wu-sheng commented on a change in pull request #6973:
URL: https://github.com/apache/skywalking/pull/6973#discussion_r636850864



##########
File path: 
apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-commons/src/main/java/org/apache/skywalking/apm/plugin/spring/mvc/commons/interceptor/AbstractMethodInterceptor.java
##########
@@ -96,31 +97,58 @@ public void beforeMethod(EnhancedInstance objInst, Method 
method, Object[] allAr
             operationName = getAcceptedMethodTypes(method) + requestURL;
         }
 
-        RequestHolder request = (RequestHolder) 
ContextManager.getRuntimeContext()
-                                                              
.get(REQUEST_KEY_IN_RUNTIME_CONTEXT);
+        Object request = 
ContextManager.getRuntimeContext().get(REQUEST_KEY_IN_RUNTIME_CONTEXT);
+
         if (request != null) {
             StackDepth stackDepth = (StackDepth) 
ContextManager.getRuntimeContext().get(CONTROLLER_METHOD_STACK_DEPTH);
 
             if (stackDepth == null) {
-                ContextCarrier contextCarrier = new ContextCarrier();
-                CarrierItem next = contextCarrier.items();
-                while (next.hasNext()) {
-                    next = next.next();
-                    next.setHeadValue(request.getHeader(next.getHeadKey()));
-                }
-
-                AbstractSpan span = 
ContextManager.createEntrySpan(operationName, contextCarrier);
-                Tags.URL.set(span, request.requestURL());
-                Tags.HTTP.METHOD.set(span, request.requestMethod());
-                span.setComponent(ComponentsDefine.SPRING_MVC_ANNOTATION);
-                SpanLayer.asHttp(span);
-
-                if 
(SpringMVCPluginConfig.Plugin.SpringMVC.COLLECT_HTTP_PARAMS) {
-                    collectHttpParam(request, span);
-                }
-
-                if 
(!CollectionUtil.isEmpty(SpringMVCPluginConfig.Plugin.Http.INCLUDE_HTTP_HEADERS))
 {
-                    collectHttpHeaders(request, span);
+                final ContextCarrier contextCarrier = new ContextCarrier();
+
+                if (IN_SERVLET_CONTAINER && 
javax.servlet.http.HttpServletRequest.class.isAssignableFrom(request.getClass()))
 {

Review comment:
       Why need full package name rather than import?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to